CN107040365A - 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
CN107040365A
CN107040365A CN201710207152.2A CN201710207152A CN107040365A CN 107040365 A CN107040365 A CN 107040365A CN 201710207152 A CN201710207152 A CN 201710207152A CN 107040365 A CN107040365 A CN 107040365A
Authority
CN
China
Prior art keywords
picture
encrypted
values
encryption
user terminal
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.)
Pending
Application number
CN201710207152.2A
Other languages
Chinese (zh)
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 CN201710207152.2A priority Critical patent/CN107040365A/en
Publication of CN107040365A publication Critical patent/CN107040365A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • 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
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC

Abstract

The embodiment of the invention discloses a kind of method and device for picture resource being encrypted in Flash protection.Present invention method includes:The request for the picture of loading first that user terminal is sent is received, the first picture is encrypted, the first picture after being encrypted;The first picture after encryption is sent to user terminal, so that the first picture obtained after the encryption of user's terminal-pair is decrypted, the first picture is obtained, and the first picture is shown in target Flash file.Because the picture that server is loaded to user terminal is encrypted in the embodiment of the present invention; picture resource only is decrypted in user terminal could normally to show; 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 the present invention relates to live video Stream Technology field, more particularly to one kind in Flash to figure The method and device of protection is encrypted in piece resource.
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 picture resource is encrypted in Flash guarantor the embodiments of the invention provide one kind The method and device of shield, security when having ensured the transmission of picture resource and having used improves HACK and obtains original image money The threshold in source, 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 clothes Business device, this method includes:
The request for the picture of loading first that user terminal is sent is received, first picture is to be stored in the server And the picture called by target Flash file;
First picture is encrypted, the first picture after being encrypted;
The first picture after the encryption is sent to the user terminal, after causing the user terminal to the encryption The first picture be decrypted, obtain first picture, and first picture is carried out in the target Flash file Display.
Further, it is described that first picture is encrypted, the step of the first picture after being encrypted, including:
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, before the corresponding MD5 values of calculating the first picture name, methods described includes:
Writing calculating MD5 is worth MD5 function interfaces;
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.
Further, methods described also includes:
The request for the loading second picture that the user terminal is sent is received, the second picture is to be stored in the service The picture called in device and by target Flash file, the second picture is different from first picture;
The second picture is encrypted, the second picture after being encrypted;
The second picture after the encryption is sent to the user terminal, after causing the user terminal to the encryption Second picture be decrypted, obtain the second picture, and the second picture is carried out in the target Flash file Display.
Further, it is described according to it is described clothes request after the second picture is encrypted, second after being encrypted The step of picture, including:
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.
Second aspect, the application provides a kind of device for picture resource being encrypted in Flash protection, applied to clothes Business device, the device includes:
Receiving unit, the request of the picture of loading first for receiving user terminal transmission, first picture is preservation The picture called in the server and by target Flash file;
Ciphering unit, for first picture to be encrypted, the first picture after being encrypted;
Transmitting element, for sending the first picture after the encryption to the user terminal, to cause the user whole The first picture after the encryption is decrypted at end, obtains first picture, and to institute in the target Flash file The first picture is stated to be shown.
Further, the ciphering unit 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, described device also includes:
Unit is write, for before the corresponding MD5 values of calculating the first picture name, writing calculating MD5 values Obtain MD5 function interfaces;
The ciphering unit specifically for:
The MD5 function interfaces are called to calculate the corresponding MD5 values of the first picture name.
Further, the receiving unit is additionally operable to receive the request for the loading second picture that the user terminal is sent, The second picture is the picture for being stored in the server and being called by target Flash file, the second picture and institute State the first picture different;
The ciphering unit is additionally operable to that the second picture is encrypted, the second picture after being encrypted;
The transmitting element is additionally operable to send the second picture after the encryption to the user terminal, to cause the use Second picture after being encrypted described in the terminal-pair of family is decrypted, and obtains the second picture, and in the target Flash file The second picture is shown.
Further, the ciphering unit 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 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.
Brief description of the drawings
Fig. 1 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. 2 is one embodiment schematic diagram of step S2 in embodiment illustrated in fig. 1;
Fig. 3 is the one of the method for picture resource being encrypted in Flash on the basis of embodiment illustrated in fig. 1 protection Individual embodiment schematic diagram;
Fig. 4 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;
Fig. 5 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;
Fig. 6 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. 7 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. 8 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. 9 is one embodiment schematic diagram of step S63 in embodiment illustrated in fig. 6;
Figure 10 is one embodiment schematic diagram of step S64 in embodiment illustrated in fig. 6;
Figure 11 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;
Figure 12 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.
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 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. 1, a reality of the method for protection picture resource is encrypted in Flash in the embodiment of the present invention Applying example includes:
S1, 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.
S2, the first picture is encrypted, the first picture after being encrypted;
S3, 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 Fig. 2 in the embodiment shown in fig. 1, step S2 may further include:
S21, 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.
S22, 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.
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 3, method can further include in the embodiment of the present invention:
S4, 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.
S5, second picture is encrypted, the second picture after being encrypted;
S6, 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 S4~S6 is similar with above-mentioned steps S1~S3, only the first picture and the second figure Piece is different, therefore their corresponding 2nd KEY values are also different from above-mentioned first KEY values, and other refer to above-described embodiment, specifically Here is omitted for implementation steps.
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, as shown in figure 4, the device includes:
Receiving unit 401, the request of the picture of loading first for receiving user terminal transmission, first picture is guarantor The picture for existing in the server and being called by target Flash file;
Ciphering unit 402, for first picture to be encrypted, the first picture after being encrypted;
Transmitting element 403, for sending the first picture after the encryption to the user terminal, to cause the user The first picture after being encrypted described in terminal-pair is decrypted, and obtains first picture, and right in the target Flash file First picture is shown.
Further, the ciphering unit 402 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 5, described device also includes:
Unit 404 is write, for before the corresponding MD5 values of calculating the first picture name, writing calculating MD5 It is worth MD5 function interfaces;
The ciphering unit 402 specifically for:
The MD5 function interfaces are called to calculate the corresponding MD5 values of the first picture name.
Further, the receiving unit 401 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 402 is additionally operable to that the second picture is encrypted, the second picture after being encrypted;
The transmitting element 403 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 402 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 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. 6, one implementation of method of protection picture resource is encrypted in Flash in the embodiment of the present invention Example includes:
S61, 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.
S62, from server the first picture after encryption is downloaded, and loaded in target Flash file after the encryption First picture;
S63, the first picture after encryption is decrypted, obtains the first picture;
S64, 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 S62, 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. 7, step (2) may further include again:
The call back function that S621, 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.
S622, 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 S63 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 8, the step S61 can specifically include:
S61 ', calling interface send the request for loading the first picture to server, to cause server receiving described ask The first picture is encrypted after asking.
Now, step S63 can specifically include:
S63 ', 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 9, step S63 can specifically include:
S631, the MD5 values for calling MD5 interfaces calculating the first picture correspondence name character;
S632, the MD5 values for corresponding to name character using the first picture call TEA to solve as the KEY values of TEA decipherment algorithms The first picture after encryption is decrypted the interface of close 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 10, above-mentioned steps S64 may further include:
S641, 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.
S642, 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.
Figure 11 is referred to, is the one of the device that protection picture resource is encrypted in Flash in the embodiment of the present invention Individual 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 figure 12, 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 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-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey The medium of sequence 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 described applied to server Method includes:
The request for the picture of loading first that user terminal is sent is received, first picture is to be stored in the server and quilt The picture that target Flash file is called;
First picture is encrypted, the first picture after being encrypted;
The first picture after the encryption is sent to the user terminal, to cause the user terminal to the after the encryption One picture is decrypted, and obtains first picture, and first picture is shown in the target Flash file Show.
2. according to the method described in claim 1, it is characterised in that described that first picture is encrypted, encrypted The step of rear the first picture, including:
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, pass through TEA AESs First picture is encrypted, the first picture after being encrypted.
3. method according to claim 2, it is characterised in that calculate the corresponding MD5 of the first picture name described Before value, methods described includes:
Writing calculating MD5 is worth MD5 function interfaces;
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.
4. method according to claim 3, it is characterised in that methods described also includes:
The request for the loading second picture that the user terminal is sent is received, the second picture is to be stored in the server And the picture called by target Flash file, the second picture is different from first picture;
The second picture is encrypted, the second picture after being encrypted;
The second picture after the encryption is sent to the user terminal, to cause the user terminal to the after the encryption Two pictures are decrypted, and obtain the second picture, and the second picture is shown in the target Flash file Show.
5. method according to claim 4, it is characterised in that described according to entering after the clothes request to the second picture The step of row encryption, second picture after being encrypted, including:
Calculate the corresponding MD5 values of the second picture name;
Use the corresponding MD5 values of the second picture name using the 2nd KEY values as TEA AESs, encrypted and calculated by TEA The second picture is encrypted method, the second picture after being encrypted.
6. a kind of device for picture resource being encrypted in Flash protection, it is characterised in that described applied to server Device includes:
Receiving unit, the request of the picture of loading first for receiving user terminal transmission, first picture is is stored in The picture stated in server and called by target Flash file;
Ciphering unit, for first picture to be encrypted, the first picture after being encrypted;
Transmitting element, for sending the first picture after the encryption to the user terminal, to cause the user terminal pair The first picture after the encryption is decrypted, and obtains first picture, and to described in the target Flash file One picture is shown.
7. device according to claim 6, it is characterised in that the ciphering unit 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, pass through TEA AESs First picture is encrypted, the first picture after being encrypted.
8. device according to claim 7, it is characterised in that described device also includes:
Unit is write, for before the corresponding MD5 values of calculating the first picture name, writing calculating MD5 to be worth MD5 Function interface;
The ciphering unit specifically for:
The MD5 function interfaces are called to calculate the corresponding MD5 values of the first picture name.
9. device according to claim 8, it is characterised in that
The receiving unit is additionally operable to receive the request for the loading second picture that the user terminal is sent, and the second picture is The picture for being stored in the server and being called by target Flash file, the second picture is different from first picture;
The ciphering unit is additionally operable to that the second picture is encrypted, the second picture after being encrypted;
The transmitting element is additionally operable to send the second picture after the encryption to the user terminal, to cause the user whole Second picture after the encryption is decrypted at end, obtains the second picture, and to institute in the target Flash file Second picture is stated to be shown.
10. device according to claim 9, it is characterised in that the ciphering unit is specifically additionally operable to:
Calculate the corresponding MD5 values of the second picture name;
Use the corresponding MD5 values of the second picture name using the 2nd KEY values as TEA AESs, encrypted and calculated by TEA The second picture is encrypted method, the second picture after being encrypted.
CN201710207152.2A 2017-03-31 2017-03-31 A kind of method and device for picture resource being encrypted in Flash protection Pending CN107040365A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710207152.2A CN107040365A (en) 2017-03-31 2017-03-31 A kind of method and device for picture resource being encrypted in Flash protection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710207152.2A CN107040365A (en) 2017-03-31 2017-03-31 A kind of method and device for picture resource being encrypted in Flash protection

Publications (1)

Publication Number Publication Date
CN107040365A true CN107040365A (en) 2017-08-11

Family

ID=59534280

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710207152.2A Pending CN107040365A (en) 2017-03-31 2017-03-31 A kind of method and device for picture resource being encrypted in Flash protection

Country Status (1)

Country Link
CN (1) CN107040365A (en)

Citations (4)

* 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
CN103427979A (en) * 2013-06-09 2013-12-04 浙江工业大学 Internet picture transparent and safe transmission method based on chaotic encryption
US20150242332A1 (en) * 2014-02-27 2015-08-27 Mangstor, Inc. Self-encrypting flash drive
CN105207782A (en) * 2015-11-18 2015-12-30 上海爱数软件有限公司 Identity verification method based on restful framework

Patent Citations (4)

* 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
CN103427979A (en) * 2013-06-09 2013-12-04 浙江工业大学 Internet picture transparent and safe transmission method based on chaotic encryption
US20150242332A1 (en) * 2014-02-27 2015-08-27 Mangstor, Inc. Self-encrypting flash drive
CN105207782A (en) * 2015-11-18 2015-12-30 上海爱数软件有限公司 Identity verification method based on restful framework

Similar Documents

Publication Publication Date Title
US20180262326A1 (en) Protecting white-box feistel network implementation against fault attack
US9372987B1 (en) Apparatus and method for masking a real user controlling synthetic identities
CN107094261A (en) The authorization check method and device of video playback
Albrecht et al. Mesh messaging in large-scale protests: Breaking Bridgefy
CN108259507A (en) For the system and method for the fragment integrity and authenticity of adaptive stream media
CN103888475B (en) A kind of guard method and device to multi-medium data
CN105871805A (en) Anti-stealing-link method and device
CN109697370A (en) Database data encipher-decipher method, device, computer equipment and storage medium
CN105978680B (en) Encryption operation method for encryption key
CN107423630A (en) Data processing method and device
CN107040799A (en) The authorization check method and device of video playback
CN107729760A (en) CSP implementation methods and intelligent terminal based on android system
CN107798236A (en) It is a kind of that the method and apparatus installed safely are realized to application program installation kit
CN114091067A (en) Sample alignment method, device, equipment and storage medium
CN108022079A (en) Sharing method, device and the computer-readable recording medium of Service Source
CN107085689A (en) A kind of method and device for picture resource being encrypted in Flash protection
CN107317819A (en) Encryption method, decryption method and its device of conventional data based on trust data form
CN107527084A (en) Electronic card processing method and processing device
CN106130951A (en) A kind of application store service management method and device
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
CN108701195B (en) Data security protection method and device
US20220114579A1 (en) System and method for oblivious information retrieval
Fadhil et al. Improved Security of a Deep Learning-Based Steganography System with Imperceptibility Preservation
CN107919953A (en) Data notarization method, apparatus, equipment, medium and server

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170811