CN107085689A - A kind of method and device for picture resource being encrypted in Flash protection - Google Patents

A kind of method and device for picture resource being encrypted in Flash protection Download PDF

Info

Publication number
CN107085689A
CN107085689A CN201710206555.5A CN201710206555A CN107085689A CN 107085689 A CN107085689 A CN 107085689A CN 201710206555 A CN201710206555 A CN 201710206555A CN 107085689 A CN107085689 A CN 107085689A
Authority
CN
China
Prior art keywords
picture
encryption
server
loading
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710206555.5A
Other languages
Chinese (zh)
Other versions
CN107085689B (en
Inventor
周志刚
张文明
陈少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710206555.5A priority Critical patent/CN107085689B/en
Publication of CN107085689A publication Critical patent/CN107085689A/en
Application granted granted Critical
Publication of CN107085689B publication Critical patent/CN107085689B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2347Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving video stream encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4405Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video stream decryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention discloses a kind of method and device for picture resource being encrypted in Flash protection, for live video Stream Technology field.Present invention method includes:The request of the first picture is loaded by being sent to server;The first picture after encryption, and the first picture in target Flash file after loading encryption are downloaded from server, the first picture after encryption is decrypted, the first picture is obtained;The first picture is shown in target Flash file.In the embodiment of the present invention due to from server load be encryption picture; only picture resource is only decryption when final shown; other moment picture resources are all encryption storages; security when having ensured the transmission of picture resource and having used; the threshold that HACK obtains original image resource is improved, so as to greatly strengthen the protection of picture resource.

Description

A kind of method and device for picture resource being encrypted in Flash protection
Technical field
The present invention relates to live video Stream Technology field, more particularly to one kind is carried out in Flash to picture resource The method and device of encipherment protection.
Background technology
At present, Flash is widely used in webpage design and web animation making and video web page broadcasting etc..It is most Video website includes webcast website all can also be used using Flash as its video player, and most web game FLASH is developed, and in Flash typically all substantial amounts of can use picture resource, otherwise the picture used is downloaded from before Picture resource be buffered in it is local after loaded, or be that download is loaded and shown later from server.Due to figure Piece resource is plaintext transmission in a network, so being easier to be cracked by HACK, so as to get all picture resources, most Greatly loss is caused to Flash developer eventually.
The content of the invention
The embodiments of the invention provide a kind of method and device for picture resource being encrypted in Flash protection, protect Security when having hindered the transmission of picture resource and having used, improves the threshold that HACK obtains original image resource, so as to Greatly strengthen the protection of picture resource.
In a first aspect, the application provides a kind of method for picture resource being encrypted in Flash protection, applied to use Family terminal, this method includes:
The request of the first picture of loading is sent to server, to cause the server after the request is received to described First picture is encrypted, and first picture is the picture for being stored in the server and being called by target Flash file;
The first picture after encryption is downloaded from the server, and the encryption is loaded in the target Flash file The first picture afterwards;
The first picture after the encryption is decrypted, first picture is obtained;
First picture is shown in the target Flash file.
Further, before first picture for downloading after encryption from the server, methods described also includes:
Define a Flash file loading example;
The call back function that picture resource loading is completed is write in registration;
The interface of first picture described in request to create;
It is described to server send load the first picture request the step of, including:
The interface is called to send the request for loading first picture to server;
First picture to after the encryption is decrypted, the step of obtaining first picture, including:
The first picture after the encryption is decrypted in the call back function, first picture is obtained.
Further, the step of call back function that picture resource loading is completed is write in the registration, including:
Register the call back function that picture resource loading is completed;
The call back function that the picture resource loading is completed is write, is encrypted with detecting described in the target Flash file Whether the first picture afterwards loads completion, and the step that the first picture after the encryption is decrypted is performed when loading and completing Suddenly.
Further, the first picture after the encryption is the first picture that TEA AESs are encrypted, the TEA encryptions Algorithm is used as KEY values using the MD5 values of the first picture correspondence name character;
First picture to after the encryption is decrypted, the step of obtaining first picture, including:
MD5 interfaces are called to calculate the MD5 values of the first picture correspondence name character;
Using the MD5 values of first picture correspondence name character as the KEY values of TEA decipherment algorithms, TEA is called to decrypt The first picture after the encryption is decrypted the interface of algorithm, obtains first picture.
Further, it is described the step of shown in target Flash file to first picture, including:
Flash picture resource object is defined, the picture resource object includes the data of first picture;
The target Flash file is imported into Flash stages, Flash stages interface is called by the picture resource object It is loaded into Flash stages, to show first picture.
Second aspect, the application provides a kind of device for picture resource being encrypted in Flash protection, applied to use Family terminal, the device includes:
Request unit, the request of the first picture is loaded for being sent to server, to cause the server receiving First picture is encrypted after stating request, first picture is to be stored in the server and by target Flash The picture that file is called;
Loading unit, for downloading the first picture after encryption from the server, and in the target Flash file Load the first picture after the encryption;
Decryption unit, the first picture after the encryption is decrypted, and obtains first picture;
Display unit, for being shown in target Flash file to first picture.
Further, described device also includes:
Definition unit, for before the first picture after server download encryption, defining a Flash file and adding Carry example;
Unit is write in registration, and the call back function that picture resource loading is completed is write for registering;
Creating unit, the interface for the first picture described in request to create;
The request unit specifically for:
The interface is called to send the request for loading first picture to server;
The decryption unit specifically for:
The first picture after the encryption is decrypted in the call back function, first picture is obtained.
Further, it is described registration write unit specifically for:
Register the call back function that picture resource loading is completed;
The call back function that the picture resource loading is completed is write, is encrypted with detecting described in the target Flash file Whether the first picture afterwards loads completion, and the step that the first picture after the encryption is decrypted is performed when loading and completing Suddenly.
Further, the first picture after the encryption is the first picture that TEA AESs are encrypted, the TEA encryptions Algorithm is used as KEY values using the MD5 values of the first picture correspondence name character;
The decryption unit specifically for:
MD5 interfaces are called to calculate the MD5 values of the first picture correspondence name character;
Using the MD5 values of first picture correspondence name character as the KEY values of TEA decipherment algorithms, TEA is called to decrypt The first picture after the encryption is decrypted the interface of algorithm, obtains first picture.
Further, the display unit specifically for:
Flash picture resource object is defined, the picture resource object includes the data of first picture;
The target Flash file is imported into Flash stages, Flash stages interface is called by the picture resource object It is loaded into Flash stages, to show first picture.
The embodiment of the present invention loads the request of the first picture by being sent to server;The after encryption is downloaded from server One picture, and the first picture in target Flash file after loading encryption, are decrypted to the first picture after encryption, obtain To the first picture;The first picture is shown in target Flash file.Due to being loaded from server in the embodiment of the present invention Be encryption picture, only picture resource is only decryption when final shown, other moment picture resources are all It is encryption storage, security when having ensured the transmission of picture resource and having used improves HACK and obtains original image resource Threshold, so as to greatly strengthen the protection of picture resource.
Brief description of the drawings
Fig. 1 is the method that subscriber terminal side picture resource is encrypted in Flash protection in the embodiment of the present invention One embodiment schematic diagram;
Fig. 2 is one embodiment signal that the call back function that picture resource loading is completed is write in registration in the embodiment of the present invention Figure;
Fig. 3 is the method that subscriber terminal side picture resource is encrypted in Flash protection in the embodiment of the present invention Another embodiment schematic diagram;
Fig. 4 is one embodiment schematic diagram of step S3 in embodiment illustrated in fig. 1;
Fig. 5 is one embodiment schematic diagram of step S4 in embodiment illustrated in fig. 1;
Fig. 6 is the device that subscriber terminal side picture resource is encrypted in Flash protection in the embodiment of the present invention One embodiment schematic diagram;
Fig. 7 is the device that subscriber terminal side picture resource is encrypted in Flash protection in the embodiment of the present invention Another embodiment schematic diagram;
Fig. 8 is the one of the method that server side picture resource is encrypted in Flash protection in the embodiment of the present invention Individual embodiment schematic diagram;
Fig. 9 is one embodiment schematic diagram of step S82 in embodiment illustrated in fig. 8;
Figure 10 is the one of the method for picture resource being encrypted in Flash on the basis of embodiment illustrated in fig. 8 protection Individual embodiment schematic diagram;
Figure 11 is the one of the device that server side picture resource is encrypted in Flash protection in the embodiment of the present invention Individual embodiment schematic diagram;
Figure 12 is the another of the device that server side picture resource is encrypted in Flash protection in the embodiment of the present invention One embodiment schematic diagram.
Embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people The every other embodiment that member is obtained under the premise of creative work is not made, should all belong to the model that the present invention is protected Enclose.
The (if present)s such as term " first ", " second " in description and claims of this specification and above-mentioned accompanying drawing It is for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that the number so used According to can exchange in the appropriate case, so as to the embodiments described herein can with except the content for illustrating or describing herein with Outer order is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that the non-exclusive bag of covering Contain, for example, the process, method, system, product or the equipment that contain series of steps or unit are not necessarily limited to what is clearly listed Those steps or unit, but may include not listing clearly or intrinsic for these processes, method, product or equipment Other steps or unit.
It is related to two hardware bodies of user terminal and server in the embodiment of the present invention, user terminal passes through network and service Device is attached, and the picture resource for being directed to use in user terminal Flash in the embodiment of the present invention has from server acquisition Scene, protection is encrypted to picture resource under such a scene.
The side that subscriber terminal side in the embodiment of the present invention picture resource is encrypted in Flash protection is described below Method, this method is applied to that picture resource is encrypted in Flash in the device of protection, and the device is located at user terminal, the use Family terminal can be mobile phone, flat board, PC etc..
Referring to Fig. 1, one implementation of method of protection picture resource is encrypted in Flash in the embodiment of the present invention Example includes:
S1, to server send load the first picture request, with cause the server after the request is received it is right First picture is encrypted;
In the present embodiment, first picture is the picture for being stored in the server and being called by target Flash file, First picture is encrypted server can use TEA AESs.
S2, download the first picture after encryption from server, and load in target Flash file after the encryption the One picture;
S3, the first picture after encryption is decrypted, obtains the first picture;
S4, in target Flash file the first picture is shown.
The embodiment of the present invention loads the request of the first picture by being sent to server;The after encryption is downloaded from server One picture, and the first picture in target Flash file after loading encryption, are decrypted to the first picture after encryption, obtain To the first picture;The first picture is shown in target Flash file.Due to being loaded from server in the embodiment of the present invention Be encryption picture, only picture resource is only decryption when final shown, other moment picture resources are all It is encryption storage, security when having ensured the transmission of picture resource and having used improves HACK and obtains original image resource Threshold, so as to greatly strengthen the protection of picture resource.
In the embodiment of the present invention, server uses the concrete implementation side that TEA AESs are encrypted to the first picture Method can be as follows:
It is then PNG picture for the first picture xxx.png wherein xxx.png.
Key=MD5.Create (" xxx.png ");
MD5 interfaces are called to carry out the MD5 values of calculating character string " xxx.png ".Call Tea.encrypt (Key, xxx.png) Picture to be encrypted;Tea.encrypt is then the interface of TEA AESs.
Wherein Key is then the key values of TEA AESs, and xxx.png is then the first image content, is equally also deposited after encryption Storage is in xxx.png.After above-mentioned calculating, the xxx.png image contents ultimately generated are then encrypted, and the present invention is implemented In example, all picture resources loaded are needed to use the above method to encrypt Flash.I.e. can be by the step just Picture resource all on server is encrypted using TEA AESs for realization.
Further, before step S2, method can also include in the embodiment of the present invention:
(1) a Flash file loading example is defined;
General, the code for the resource that Loaded Image in Flash file is all write by ActionScript, therefore, this In embodiment, ActionScript Loader examples can be defined first, and one is provided in ActionScript Loader classes are used for loading PNG picture resource files.Therefore, the Loader examples for defining an ActionScript are implemented Mode can be as follows:
Var pngLoader:Loader=new Loader ();
(2) call back function that picture resource loading is completed is write in registration;
Wherein, as shown in Fig. 2 step (2) may further include again:
The call back function that S21, registration picture resource loading are completed;
The object of a Loader example is provided in ActionScript, wherein Loader objects have one ContentLoadInfo attribute, call back function (such as call back function of registered events is carried out using the attribute PngLoadCompleteHandler), after Loader loadings complete a picture file, the event letter of this registration can be adjusted back Number, to notify picture file to load completion.
An addEventListener interface is provided in Loader contentLoadInfo attributes to be used for registering Event.The specific prototype of the interface is as follows:
Wherein first parameter type:String is used for representing the event type of registration, is then corresponding to the present embodiment Event.COMPLETE, represents registration Flash file (such as SWF files) loading completion event.Wherein second parameter listener:Function is used for representing the call back function after the completion of the completion event of registration, is performed for triggering call back function. Wherein the 3rd parameter priority:Int is used for the priority for indicating event, uses default value 0.Wherein the 4th parameter useWeakReference:Boolean specifies call back function to be weak application or strongly reference, uses default value false.
S22, the call back function for writing picture resource loading completion, to detect first after being encrypted in target Flash file Whether picture loads completion, and performs the step of the first picture after encryption is decrypted when loading and completing.
Call back function pngLoadCompleteHandler is write, this function is that the registration completion event called above is filled out The call back function entered, the call back function is used to detect whether the first picture after encrypting in target Flash file loads completion, and The step of the first picture after encryption is decrypted, i.e. step S3 are performed when loading and completing.
(3), the interface of the first picture described in request to create;
ActionScript provides interface and is used for from network or locally asking first picture, and physical interface is as follows:
URLRequest(url:String=null)
Wherein parameter url:String indicates URL addresses or the local path of incoming first picture.
Now, as shown in figure 3, the step S1 can specifically include:
S1 ', calling interface send the request for loading the first picture to server, to cause server receiving the request The first picture is encrypted afterwards.
Now, step S3 can specifically include:
S3 ', in call back function the first picture after encryption is decrypted, obtains the first picture.
Further, the first picture after the encryption is the first picture that TEA AESs are encrypted, the TEA encryptions Algorithm is used as KEY values using the MD5 values of the first picture correspondence name character;
Now, as shown in figure 4, step S3 can specifically include:
S31, the MD5 values for calling MD5 interfaces calculating the first picture correspondence name character;
S32, the MD5 values for corresponding to name character using the first picture call TEA to decrypt as the KEY values of TEA decipherment algorithms The first picture after encryption is decrypted the interface of algorithm, obtains the first picture.
The readjustment in invocation step S6 is understood after the completion of server request is downloaded, after being loaded into internal memory when the first picture Function pngLoadCompleteHandler notifies the data to have loaded completion.There is parameter in call back function simultaneously Attribute is used for passing back the image data of loading, is then specifically evt.target.content.bitmapData, wherein BitmapData then stores the image data of the encryption of loading.Then it can use TEA algorithms that data are decrypted with behaviour Make, specific implementation is as follows:
For example it is then PNG picture for the first picture xxx.png wherein xxx.png.
Key=MD5.Create (" xxx.png ");
Call MD5 interfaces to carry out the MD5 values of calculating character string " xxx.png ", then call Tea.decrypt (Key, Evt.target.content.bitmapData) picture is decrypted.Wherein, Tea.decrypt is then TEA decryption calculations The interface of method;Key is then the key values of TEA decipherment algorithms, and key values when TEA encryptions are carried out with the first picture are identical; Evt.target.content.bitmapData be then from the image contents of PNG first after the encryption that server is downloaded and is loaded, Equally it also is stored in after decryption in evt.target.content.bitmapData.
So far, just realized by the step calls TEA algorithms that picture is decrypted out in the PNG pictures to loading The first original picture resource.
Further, as shown in figure 5, above-mentioned steps S4 may further include:
S41, the picture resource object for defining a Flash;
Wherein, the picture resource object includes the data of first picture;
After the first picture after to encryption is decrypted, then it can directly be loaded into Flash stages and be shown Show.It is implemented as follows:
Firstly the need of the picture resource object for defining a Flash, the picture resource object includes first picture Data, specific implementation is as follows:
var img:Bitmap=new Bitmap (evt.target.content.bitmapData);
Wherein img is then the object picture, during parameter evt.target.content.bitmapData is then step S32 Image data after decryption.
S42, by target Flash file import Flash stages, call Flash stages interface by the picture resource object It is loaded into Flash stages, to show first picture.
Flash picture resource object is being defined, target Flash file is then imported into Flash stages, called Picture is added in stage by the interface of Flash stages to be shown.
stage.addChild(img);
So far, it is achieved that by the step and the first picture after decryption is carried out to be shown in Flash stages.
TEA AESs are the KEY for needing to use a KEY to be used as AES in encryption data, decryption When be also required to just decrypt correct data using a same KEY.One Flash file may be simultaneously in a server Middle loading plurality of pictures, now, in order to further strengthen the security of AES in the embodiment of the present invention, to each picture Resource can use different KEY to encrypt the picture, further, and the KEY of each picture resource is then by calculating it The cryptographic Hash of the filename of picture resource is used as key values, and such as MD5 is (widely used a kind of scattered for computer safety field Array function) value is used as KEY values, because the name of each filename is different so that each picture resource encryption is used KEY be different.Therefore, method can further include in the embodiment of the present invention:
The request of loading second picture is sent to server, to cause the server after the request is received to described Second picture is encrypted, and the second picture is the picture for being stored in the server and being called by target Flash file;
The second picture after encryption is downloaded from the server, and the encryption is loaded in the target Flash file Second picture afterwards;
Second picture after the encryption is decrypted, the second picture is obtained;
The second picture is shown in the target Flash file.
In the embodiment of the present invention, to the processing in the processing mode and above-described embodiment of above-mentioned second picture to the first picture Mode is similar, and here is omitted.
The embodiment for the device for picture resource being encrypted in Flash protection is described below in the embodiment of the present invention, The device applies equally to user terminal.
Referring to Fig. 6, one of device for protection picture resource is encrypted in Flash in the embodiment of the present invention Embodiment schematic diagram, the device includes:
Request unit 601, the request of the first picture is loaded for being sent to server, to cause the server receiving First picture is encrypted after the request;
Loading unit 602, for downloading the first picture after encryption from the server, and in target Flash texts The first picture after the encryption is loaded in part, first picture is to be stored in the server and by target Flash texts The picture that part is called;
Decryption unit 603, the first picture after the encryption is decrypted, and obtains first picture;
Display unit 604, for being shown in target Flash file to first picture.
Further, as shown in fig. 7, described device also includes:
Definition unit 605, for before the first picture after server download encryption, defining a Flash text Part loads example;
Unit 606 is write in registration, and the call back function that picture resource loading is completed is write for registering;
Creating unit 607, the interface for the first picture described in request to create;
The request unit 601 specifically for:
The interface is called to send the request for loading first picture to server;
The decryption unit 603 specifically for:
The first picture after the encryption is decrypted in the call back function, first picture is obtained.
Further, it is described registration write unit 606 specifically for:
Register the call back function that picture resource loading is completed;
The call back function that the picture resource loading is completed is write, is encrypted with detecting described in the target Flash file Whether the first picture afterwards loads completion, and the step that the first picture after the encryption is decrypted is performed when loading and completing Suddenly.
Further, the first picture after the encryption is the first picture that TEA AESs are encrypted, the TEA encryptions Algorithm is used as KEY values using the MD5 values of the first picture correspondence name character;
The decryption unit 603 specifically for:
MD5 interfaces are called to calculate the MD5 values of the first picture correspondence name character;
Using the MD5 values of first picture correspondence name character as the KEY values of TEA decipherment algorithms, TEA is called to decrypt The first picture after the encryption is decrypted the interface of algorithm, obtains first picture.
Further, the display unit 604 specifically for:
Flash picture resource object is defined, the picture resource object includes the data of first picture;
The target Flash file is imported into Flash stages, Flash stages interface is called by the picture resource object It is loaded into Flash stages, to show first picture.
The method that server side picture resource is encrypted in Flash protection in the embodiment of the present invention is described below, This method is applied to that picture resource is encrypted in Flash in the device of protection, and the device is applied to server.
Referring to Fig. 8, a reality of the method for protection picture resource is encrypted in Flash in the embodiment of the present invention Applying example includes:
S81, the request for receiving the picture of loading first that user terminal is sent;
Wherein, the picture that first picture is called in the server and by target Flash file for preservation.
S82, the first picture is encrypted, the first picture after being encrypted;
S83, to user terminal send the first picture after the encryption so that encrypt described in user's terminal-pair after the One picture is decrypted, and obtains the first picture, and the first picture is shown in target Flash file.
The embodiment of the present invention by receive user terminal send the picture of loading first request, the first picture is added It is close, the first picture after being encrypted;The first picture after encryption is sent to user terminal, so as to obtain after the encryption of user's terminal-pair The first picture be decrypted, obtain the first picture, and the first picture is shown in target Flash file.The present invention Because the picture that server is loaded to user terminal is encrypted in embodiment, picture money only is decrypted in user terminal Source could normally show that other moment picture resources are all encryption storages, when having ensured the transmission of picture resource and having used Security, improves the threshold that HACK obtains original image resource, so as to greatly strengthen the protection of picture resource.
As shown in figure 9, in the embodiment shown in fig. 8, step S82 may further include:
S821, the corresponding MD5 values of the first picture name of calculating;
In the present embodiment, before the corresponding MD5 values of calculating the first picture name, this method includes:Write Calculating MD5 is worth MD5 function interfaces;
The specific interface for writing MD5 functions is as follows:
void Md5Create(char*input,int input_len,char*md5Result);
Wherein, parameter char*input needs to calculate MD5 data for input;Parameter int input_len need for input Want the length of verification data;Parameter char*md5Result is the MD5 result datas calculated.
A MD5 function interface has just been write by the step calls this function interface algorithm to calculate for subsequent step The corresponding MD5 values of whole first picture name.
Now, it is described the step of calculate the first picture name corresponding MD5 values, including:
The MD5 function interfaces are called to calculate the corresponding MD5 values of the first picture name.
S822, using first KEY value of the corresponding MD5 values of the first picture name as TEA AESs, by TEA plus First picture is encrypted close algorithm, the first picture after being encrypted.
The step concrete implementation method is described with a specific example below, it is specific as follows:
For the first picture xxx.png, wherein xxx.png is then PNG picture.
By MD5 values and the first KEY values set in advance, by TEA AESs the first picture is encrypted as Under:
Key=MD5.Create (" xxx.png ");
Call MD5 interfaces to carry out the MD5 values of calculating character string " xxx.png ", then call Tea.encrypt (Key, Xxx.png) picture is encrypted;
Wherein, Tea.encrypt is then the interface of TEA AESs;Key is then the key values of TEA AESs; Xxx.png is then PNG image content, also equally is stored in after encryption in xxx.png.
After above-mentioned calculating, first picture xxx.png its image content ultimately generated is then encrypted.
Further, a Flash file may load plurality of pictures in a server simultaneously, now, in order to enter The security of the reinforcement AES of one step, the picture, each picture are encrypted to each picture resource using different KEY The KEY of resource is then (widely used a kind of scattered for computer safety field by calculating the MD5 of the filename of its picture resource Array function) value is used as KEY values.Because the name of each filename is different so that each picture resource encryption is used KEY be different.Therefore, as shown in Figure 10, method can further include in the embodiment of the present invention:
S84, the request for receiving the loading second picture that user terminal is sent;
Wherein, second picture is the picture for being stored in the server and being called by target Flash file, described second Picture is different from first picture.
S85, second picture is encrypted, the second picture after being encrypted;
S86, to user terminal send encryption after second picture so that user's terminal-pair encryption after second picture enter Row decryption, obtains second picture, and second picture is shown in target Flash file.
Wherein, it is above-mentioned according to it is described clothes request after the second picture is encrypted, the second picture after being encrypted;
Calculate the corresponding MD5 values of the second picture name;
The corresponding MD5 values of the second picture name are used using the 2nd KEY values as TEA AESs, by TEA plus The second picture is encrypted close algorithm, the second picture after being encrypted.
Specific implementation in above-mentioned steps S84~S86 is similar with above-mentioned steps S81~S83, only the first picture and Two pictures are different, therefore their corresponding 2nd KEY values are also different from above-mentioned first KEY values, and other refer to above-described embodiment, Here is omitted for specific implementation step.
The device that server side in the embodiment of the present invention picture resource is encrypted in Flash protection is described below, The device is applied to server, and as shown in figure 11, the device includes:
Receiving unit 1101, the request of the picture of loading first for receiving user terminal transmission, first picture is The picture for being stored in the server and being called by target Flash file;
Ciphering unit 1102, for first picture to be encrypted, the first picture after being encrypted;
Transmitting element 1103, for sending the first picture after the encryption to the user terminal, to cause the use The first picture after being encrypted described in the terminal-pair of family is decrypted, and obtains first picture, and in the target Flash file First picture is shown.
Further, the ciphering unit 1102 specifically for:
Calculate the corresponding MD5 values of the first picture name;
Using the corresponding MD5 values of the first picture name as the first KEY values of TEA AESs, encrypted by TEA First picture is encrypted algorithm, the first picture after being encrypted.
Further, as shown in figure 12, described device also includes:
Unit 1104 is write, for before the corresponding MD5 values of calculating the first picture name, writing calculating MD5 is worth MD5 function interfaces;
The ciphering unit 1102 specifically for:
The MD5 function interfaces are called to calculate the corresponding MD5 values of the first picture name.
Further, the receiving unit 1101 is additionally operable to receive asking for the loading second picture that the user terminal is sent Ask, the second picture is the picture for being stored in the server and being called by target Flash file, the second picture with First picture is different;
The ciphering unit 1102 is additionally operable to that the second picture is encrypted, the second picture after being encrypted;
The transmitting element 1103 is additionally operable to send the second picture after the encryption to the user terminal, to cause State user terminal the second picture after the encryption is decrypted, obtain the second picture, and in target Flash texts The second picture is shown in part.
Further, the ciphering unit 1102 is specifically additionally operable to:
Calculate the corresponding MD5 values of the second picture name;
The corresponding MD5 values of the second picture name are used using the 2nd KEY values as TEA AESs, by TEA plus The second picture is encrypted close algorithm, the second picture after being encrypted.
The method and the service that picture resource are encrypted in Flash protection of subscriber terminal side in the embodiment of the present invention The method that device side picture resource is encrypted in Flash protection can be cross-referenced, and the part not being described in side can join According to opposite side method.The similarly device and server side that picture resource are encrypted in Flash protection of subscriber terminal side The device for picture resource being encrypted in Flash protection can also be cross-referenced, does not limit herein.
It is apparent to those skilled in the art that, for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, may be referred to the corresponding process in preceding method embodiment, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method can be with Realize by another way.For example, device embodiment described above is only schematical, for example, the unit Divide, only a kind of division of logic function there can be other dividing mode when actually realizing, such as multiple units or component Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or The coupling each other discussed or direct-coupling or communication connection can be the indirect couplings of device or unit by some interfaces Close or communicate to connect, can be electrical, machinery or other forms.
The unit illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
If the integrated unit is realized using in the form of SFU software functional unit and as independent production marketing or used When, it can be stored in a computer read/write memory medium.Understood based on such, technical scheme is substantially The part contributed in other words to prior art or all or part of the technical scheme can be in the form of software products Embody, the computer software product is stored in a storage medium, including some instructions are to cause a computer Equipment (can be personal computer, server, or network equipment etc.) performs the complete of each embodiment methods described of the invention Portion or part steps.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read- OnlyMemory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various to deposit Store up the medium of program code.
Described above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to before Embodiment is stated the present invention is described in detail, it will be understood by those within the art that:It still can be to preceding State the technical scheme described in each embodiment to modify, or equivalent substitution is carried out to which part technical characteristic;And these Modification is replaced, and the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (10)

1. a kind of method for picture resource being encrypted in Flash protection, it is characterised in that applied to user terminal, institute The method of stating includes:
The request of the first picture of loading is sent to server, to cause the server after the request is received to described first Picture is encrypted, and first picture is the picture for being stored in the server and being called by target Flash file;
The first picture after encryption is downloaded from the server, and after loading the encryption in the target Flash file First picture;
The first picture after the encryption is decrypted, first picture is obtained;
First picture is shown in the target Flash file.
2. according to the method described in claim 1, it is characterised in that described that the first picture after encryption is downloaded from the server Before, methods described also includes:
Define a Flash file loading example;
The call back function that picture resource loading is completed is write in registration;
The interface of first picture described in request to create;
It is described to server send load the first picture request the step of, including:
The interface is called to send the request for loading first picture to server;
First picture to after the encryption is decrypted, the step of obtaining first picture, including:
The first picture after the encryption is decrypted in the call back function, first picture is obtained.
3. method according to claim 2, it is characterised in that the readjustment letter that picture resource loading is completed is write in the registration Several steps, including:
Register the call back function that picture resource loading is completed;
The call back function that the picture resource loading is completed is write, to detect described in the target Flash file after encryption Whether the first picture loads completion, and performs the step of the first picture after the encryption is decrypted when loading and completing.
4. according to the method described in claim 1, it is characterised in that the first picture after the encryption adds for TEA AESs The first close picture, the TEA AESs are used as KEY values using the MD5 values of the first picture correspondence name character;
First picture to after the encryption is decrypted, the step of obtaining first picture, including:
MD5 interfaces are called to calculate the MD5 values of the first picture correspondence name character;
Using the MD5 values of first picture correspondence name character as the KEY values of TEA decipherment algorithms, TEA decipherment algorithms are called Interface the first picture after the encryption is decrypted, obtain first picture.
5. according to the method described in claim 1, it is characterised in that it is described in target Flash file to first picture The step of being shown, including:
Flash picture resource object is defined, the picture resource object includes the data of first picture;
The target Flash file is imported into Flash stages, calls Flash stages interface to load the picture resource object Into Flash stages, to show first picture.
6. a kind of device for picture resource being encrypted in Flash protection, it is characterised in that applied to user terminal, institute Stating device includes:
Request unit, the request of the first picture is loaded for being sent to server, to cause the server receiving described ask First picture is encrypted after asking, first picture is to be stored in the server and by target Flash file The picture called;
Loading unit, is loaded for downloading the first picture after encryption from the server, and in the target Flash file The first picture after the encryption;
Decryption unit, the first picture after the encryption is decrypted, and obtains first picture;
Display unit, for being shown in the target Flash file to first picture.
7. device according to claim 6, it is characterised in that described device also includes:
Definition unit, for before the first picture after server download encryption, defining a Flash file loading real Example;
Unit is write in registration, and the call back function that picture resource loading is completed is write for registering;
Creating unit, the interface for the first picture described in request to create;
The request unit specifically for:
The interface is called to send the request for loading first picture to server;
The decryption unit specifically for:
The first picture after the encryption is decrypted in the call back function, first picture is obtained.
8. device according to claim 7, it is characterised in that the registration write unit specifically for:
Register the call back function that picture resource loading is completed;
The call back function that the picture resource loading is completed is write, to detect described in the target Flash file after encryption Whether the first picture loads completion, and performs the step of the first picture after the encryption is decrypted when loading and completing.
9. device according to claim 6, it is characterised in that the first picture after the encryption adds for TEA AESs The first close picture, the TEA AESs are used as KEY values using the MD5 values of the first picture correspondence name character;
The decryption unit specifically for:
MD5 interfaces are called to calculate the MD5 values of the first picture correspondence name character;
Using the MD5 values of first picture correspondence name character as the KEY values of TEA decipherment algorithms, TEA decipherment algorithms are called Interface the first picture after the encryption is decrypted, obtain first picture.
10. device according to claim 6, it is characterised in that the display unit specifically for:
Flash picture resource object is defined, the picture resource object includes the data of first picture;
The target Flash file is imported into Flash stages, calls Flash stages interface to load the picture resource object Into Flash stages, to show first picture.
CN201710206555.5A 2017-03-31 2017-03-31 Method and device for carrying out encryption protection on picture resources in Flash Active CN107085689B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710206555.5A CN107085689B (en) 2017-03-31 2017-03-31 Method and device for carrying out encryption protection on picture resources in Flash

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710206555.5A CN107085689B (en) 2017-03-31 2017-03-31 Method and device for carrying out encryption protection on picture resources in Flash

Publications (2)

Publication Number Publication Date
CN107085689A true CN107085689A (en) 2017-08-22
CN107085689B CN107085689B (en) 2020-04-10

Family

ID=59614777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710206555.5A Active CN107085689B (en) 2017-03-31 2017-03-31 Method and device for carrying out encryption protection on picture resources in Flash

Country Status (1)

Country Link
CN (1) CN107085689B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069933A (en) * 2018-01-22 2019-07-30 北大方正集团有限公司 Document handling method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101847185A (en) * 2009-03-27 2010-09-29 浙江省农业科学院 Anti-theft protection method for network pictures based on Flash embedded browser
CN103258167A (en) * 2013-05-10 2013-08-21 广州杰赛科技股份有限公司 Method for protecting png picture in handheld device
CN103427979A (en) * 2013-06-09 2013-12-04 浙江工业大学 Internet picture transparent and safe transmission method based on chaotic encryption
CN105207782A (en) * 2015-11-18 2015-12-30 上海爱数软件有限公司 Identity verification method based on restful framework
CN106101866A (en) * 2016-07-14 2016-11-09 观止云(北京)信息技术有限公司 A kind of method of HLS Streaming Media DRM

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101847185A (en) * 2009-03-27 2010-09-29 浙江省农业科学院 Anti-theft protection method for network pictures based on Flash embedded browser
CN103258167A (en) * 2013-05-10 2013-08-21 广州杰赛科技股份有限公司 Method for protecting png picture in handheld device
CN103427979A (en) * 2013-06-09 2013-12-04 浙江工业大学 Internet picture transparent and safe transmission method based on chaotic encryption
CN105207782A (en) * 2015-11-18 2015-12-30 上海爱数软件有限公司 Identity verification method based on restful framework
CN106101866A (en) * 2016-07-14 2016-11-09 观止云(北京)信息技术有限公司 A kind of method of HLS Streaming Media DRM

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069933A (en) * 2018-01-22 2019-07-30 北大方正集团有限公司 Document handling method and device
CN110069933B (en) * 2018-01-22 2022-02-18 北大方正集团有限公司 File processing method and device

Also Published As

Publication number Publication date
CN107085689B (en) 2020-04-10

Similar Documents

Publication Publication Date Title
US11675880B2 (en) Securing webpages, webapps and applications
US9455833B2 (en) Behavioral fingerprint in a white-box implementation
CN107094261A (en) The authorization check method and device of video playback
CN111143869B (en) Application package processing method and device, electronic equipment and storage medium
CN108259507A (en) For the system and method for the fragment integrity and authenticity of adaptive stream media
EP3169017B1 (en) Split-and-merge approach to protect against dfa attacks
CN105897746A (en) Cross-website login method, terminal and website server
CN107135077A (en) Software protecting method and device
CN107302706A (en) Image anti-stealing link method, device and electronic equipment
CN105871805A (en) Anti-stealing-link method and device
CN107040799A (en) The authorization check method and device of video playback
CN105978680B (en) Encryption operation method for encryption key
US20240134965A1 (en) Model running methods and apparatuses
CN112035827A (en) Cipher data processing method, device, equipment and readable storage medium
CN107729760A (en) CSP implementation methods and intelligent terminal based on android system
CN116455572B (en) Data encryption method, device and equipment
CN114091067A (en) Sample alignment method, device, equipment and storage medium
Fadhil et al. Improved Security of a Deep Learning-Based Steganography System with Imperceptibility Preservation
CN107085689A (en) A kind of method and device for picture resource being encrypted in Flash protection
CN108055356A (en) A kind of information processing method, server, client and readable storage medium storing program for executing
CN107527084A (en) Electronic card processing method and processing device
CN107317819A (en) Encryption method, decryption method and its device of conventional data based on trust data form
EP2940917A1 (en) Behavioral fingerprint in a white-box implementation
CN107040365A (en) A kind of method and device for picture resource being encrypted in Flash protection
CN111931222B (en) Application data encryption method, device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant