Summary of the invention
One of the object of the invention is for a kind of encryption method and device of character library are provided, in order to have promoted the confidentiality of character library.
The present invention proposes a kind of encryption method of character library, and said character library comprises internal code information and lattice information, and the encryption method of said character library comprises step:
Disperse computing to generate secondary key with first key to internal code information;
With said secondary key lattice information is encrypted generation dot array data cipher-text information;
With the combined ciphering generation identifying code of second key to said dot array data cipher-text information or said internal code information and said dot array data cipher-text information.
Preferably, said method also comprises the step of storing said identifying code.
Preferably, above-mentioned second key comprises the said secondary key that disperses computing to generate to internal code information.
Preferably, said method also comprises the step that said identifying code is tested.
Preferably, the above-mentioned step that said identifying code is tested specifically comprises step:
With the combined ciphering computing generation check code of said second key to said dot array data cipher-text information or said internal code information and said dot array data cipher-text information;
More said check code and identifying code;
Said check code is that identical then the continuation carried out subsequent operation with the comparative result of identifying code, otherwise returns mistake.
The present invention proposes a kind of encryption device of character library, and said character library comprises internal code information and lattice information, and the encryption device of said character library comprises:
The secondary key generation module is used for disperseing computing to generate secondary key to internal code information first key;
The lattice information encrypting module is used for said secondary key is encrypted generation dot array data cipher-text information to lattice information;
The identifying code generation module is used for the combined ciphering generation identifying code of second key to said dot array data cipher-text information or said internal code information and said dot array data cipher-text information.
Preferably, said apparatus also comprises the identifying code memory module, is used to store said identifying code.
Preferably, above-mentioned second key comprises the said secondary key that disperses computing to generate to internal code information.
Preferably, said apparatus also comprises the identifying code inspection module, is used for said identifying code is tested.
Preferably, above-mentioned identifying code inspection module specifically comprises:
Check code cryptographic calculation unit is used for the combined ciphering computing generation check code of said second key to said dot array data cipher-text information or said internal code information and said dot array data cipher-text information;
Comparing unit is used for more said check code and identifying code;
The assay processing unit is used for handling subsequent operation according to the comparative result of said check code and identifying code, and said check code is that identical then the continuation carried out subsequent operation with the comparative result of identifying code, otherwise returns mistake.
From the above, the embodiment of the invention disperses computing to generate secondary key through providing with first key to internal code information; With said secondary key lattice information is encrypted generation dot array data cipher-text information; With character library encryption method and the device of second key to the combined ciphering generation identifying code of said dot array data cipher-text information or said internal code information and said dot array data cipher-text information, thereby the confidentiality of lifting character library further reaches anti-tamper purpose.
Embodiment
With reference to Fig. 1, the present invention proposes the encryption method of the character library of an embodiment, and said character library comprises internal code information and lattice information, and the encryption method of said character library comprises step:
S11 disperses computing to generate secondary key with first key to internal code information;
S12 encrypts generation dot array data cipher-text information with said secondary key to lattice information;
S13 is with the combined ciphering generation identifying code of second key to said dot array data cipher-text information or said internal code information and said dot array data cipher-text information.
S11 is said like step, and available first key disperses computing to generate secondary key to each internal code information one by one, and said secondary key can be a kind of MAC sign indicating number (Message Authentication Code, a message authentication code).Above-mentioned first key can be kept in the memory block of device interior, can be the random key that generates in process of production, also can be the key that solidifies in process of production.Above-mentioned internal code information has write down the pairing binary code of character.Above-mentioned dispersion computing realizes through decentralized algorithm.Said decentralized algorithm can be an AES, can not be AES also, like the hmac algorithm based on cryptographic hash algorithm construction message authentication code.Above-mentioned decentralized algorithm can be DeriveKey=AlgDerive (Key; Info), be example with this algorithm, the Key in the above-mentioned algorithm can be first key, Info can be an internal code information, generates secondary key through after the above-mentioned algorithm computing.
S12 is said like step, can be one by one with said secondary key corresponding lattice information be with it encrypted to generate the dot array data cipher-text information.Said information recording lattice the character color and the brightness that are shown in each corresponding point of display device, the lattice information of each character and internal code information are corresponding one by one.Said dot array data cipher-text information is that lattice information is encrypted a kind of ciphertext that the back generates.All be inequality owing to the pairing secondary key of each internal code information as stated, thereby each internal code information lattice data corresponding cipher-text information is also all inequality, and the dot array data cipher-text information is associated with ISN.Above-mentioned encryption realizes that through AES said AES can be a symmetry algorithm, and above-mentioned AES can be EncData=AlgEnc (Key; Data).Wherein, the Key in the above-mentioned AES can be second key, and Data can be a lattice information, through generating the dot array data cipher-text information after the above-mentioned algorithm computing.
S13 is said like step, and available second key is encrypted said dot array data cipher-text information and generated identifying code, and also available second key generates identifying code to the combined ciphering of said internal code information and said dot array data cipher-text information.Said identifying code also can be a kind of MAC sign indicating number.Said second key can be same key with said first key, also can be different.Said second key can also be the said secondary key that disperses computing to generate to internal code information.With the combined ciphering generation identifying code of second key to said dot array data cipher-text information or said internal code information and said dot array data cipher-text information; The encryption here realizes that through the identifying code generating algorithm said identifying code generating algorithm can generate the raw data of random length the authorization information of regular length; And any bit (Byte) of raw data is modified, and authorization information will be different.The identifying code generating algorithm can be MACData=AlgMAC (Key; Data), wherein the Key in this identifying code generating algorithm can be second key, and Data can be the dot array data cipher-text information, through generating check code after the computing of above-mentioned identifying code generating algorithm; Key in the above-mentioned identifying code generating algorithm can also be second key, and Data can be the combination of said internal code information and said dot array data cipher-text information, through generating check code after the computing of above-mentioned identifying code generating algorithm.
The embodiment of the invention generates secondary key through with first key internal code information being carried out cryptographic calculation; With said secondary key lattice information is encrypted generation dot array data cipher-text information; The combined ciphering of said dot array data cipher-text information or said internal code information and said dot array data cipher-text information is generated the method for identifying code with second key; Can prevent the illegal users from replacing character library, thereby effectively promote the confidentiality of character library.
With reference to Fig. 2, one embodiment of the invention is based on the encryption method of the character library of the foregoing description, and than said method, this method further comprises step:
S14 stores said identifying code.
S14 is said like step, and whether the identifying code that storage generates is used to check the internal code information of character library and lattice information to be distorted in the storer of device interior.
Be that the secondary key that said internal code information was generated is an example with second key below, details are as follows to present embodiment:
Disperse computing to generate secondary key with first key to each internal code information in the character library; Use the secondary key that generated pair to encrypt successively and generate the dot array data cipher-text information with the pairing lattice information of said internal code information; Carry out cryptographic calculation with said secondary key pair and said secondary key lattice data corresponding cipher-text information respectively and generate identifying code; Store said identifying code successively.
Following is that same key is an example with second key and first key then, and details are as follows to present embodiment:
Disperse computing to generate secondary key with first key to each internal code information in the character library; Pair encrypt with secondary key that internal code information generated successively and generate the dot array data cipher-text information with the pairing lattice information of internal code information; With first key cryptographic calculation is carried out in the combination of all said internal code informations and said dot array data cipher-text information and generate identifying code; Store said identifying code.
With reference to Fig. 3, one embodiment of the invention is based on the encryption method of the character library of the foregoing description, and than said method, this method further comprises step:
S15 tests to said identifying code.
With reference to Fig. 4, as one embodiment of the present of invention, step S15 can further comprise step:
S151 carries out cryptographic calculation with second key to the combination of said dot array data cipher-text information or said internal code information and said dot array data cipher-text information and generates check code;
S152, more said check code and identifying code;
S153, said check code is that identical then the continuation carried out subsequent operation with the comparative result of identifying code, otherwise returns mistake.
S15 is said like step, and with the combined ciphering generation check code of said second key to said dot array data cipher-text information or said internal code information and said dot array data cipher-text information, said check code also can be a kind of MAC sign indicating number.The encryption here realizes through above-mentioned identifying code generating algorithm.Generate check code after the above-mentioned identifying code generating algorithm of the combination process computing of said second key and said dot array data cipher-text information or said internal code information and said dot array data cipher-text information; More said check code and above-mentioned identifying code; Continue to carry out subsequent operation if the result is identical, otherwise return mistake.
The embodiment of the invention is through disperseing computing to generate secondary key with first key to internal code information; With said secondary key lattice information is encrypted generation dot array data cipher-text information, with the combined ciphering generation identifying code of second key to said dot array data cipher-text information or said internal code information and said dot array data cipher-text information; To the character library encryption method that said identifying code is tested, can after the illegal users from replacing character library, remind the user, thereby the confidentiality of lifting character library further reaches anti-tamper purpose.
Following is that the secondary key that said internal code information was generated is an example with second key still, and details are as follows to present embodiment:
Disperse computing to generate secondary key with first key to each internal code information in the character library; Use the secondary key that generated pair to encrypt successively and generate the dot array data cipher-text information with the pairing lattice information of internal code information; Carry out cryptographic calculation with said secondary key pair and the pairing data cipher-text information of said secondary key respectively and generate identifying code; Store said identifying code successively.Launch character library, carry out cryptographic calculation with said secondary key pair and the pairing data cipher-text information of said secondary key respectively and generate check code; The identifying code that more said successively check code is corresponding with said check code; Said check code is that identical then the continuation carried out subsequent operation with the comparative result of its corresponding identifying code, otherwise returns mistake.
Following is that same key is an example with second key and first key then, and details are as follows to present embodiment:
Disperse computing to generate secondary key with first key to each internal code information in the character library; Pair encrypt with secondary key that internal code information generated successively and generate the dot array data cipher-text information with the pairing lattice information of internal code information; With first key cryptographic calculation is carried out in the combination of all said internal code informations and all said dot array data cipher-text information and generate identifying code; Store said identifying code.Launch character library, with first key cryptographic calculation is carried out in the combination of all said internal code informations and all said dot array data cipher-text information and generate check code; More said check code and said identifying code; Said check code is that identical then the continuation carried out subsequent operation with the comparative result of said identifying code, otherwise returns mistake.
With reference to Fig. 5, the present invention proposes the encryption device 10 of the character library of another embodiment, and said character library comprises internal code information and lattice information, and said character library encryption device comprises:
Secondary key generation module 11 is used for disperseing computing to generate secondary key to internal code information first key;
Lattice information encrypting module 12 is used for said secondary key is encrypted generation dot array data cipher-text information to lattice information;
Identifying code generation module 13 is used for the combined ciphering generation identifying code of second key to said dot array data cipher-text information or said dot array data cipher-text information and said internal code information.
Said secondary key generation module 11 can be used for disperseing computing to generate secondary key to each internal code information one by one first key, and said secondary key can be a kind of MAC sign indicating number (Message Authentication Code, a message authentication code).Above-mentioned first key can be kept in the memory block of device interior, can be the random key that generates in process of production, also can be the key that solidifies in process of production.Above-mentioned internal code information has write down the pairing binary code of character.Above-mentioned dispersion computing realizes through decentralized algorithm.Said decentralized algorithm can be an AES, can not be AES also, like the hmac algorithm based on cryptographic hash algorithm construction message authentication code.Above-mentioned decentralized algorithm can be DeriveKey=AlgDerive (Key; Info), be example with this algorithm, the Key in the above-mentioned algorithm can be first key, Info can be an internal code information, generates secondary key through after the above-mentioned algorithm computing.
Said lattice information encrypting module 12 can be seriatim encrypted said secondary key and is generated the dot array data cipher-text information to corresponding lattice information with it.Said information recording lattice the character color and the brightness that are shown in each corresponding point of display device, the lattice information of each character and internal code information are corresponding one by one.Said dot array data cipher-text information is that lattice information is encrypted a kind of ciphertext that the back generates.All be inequality owing to the pairing secondary key of each internal code information as stated, thereby each internal code information lattice data corresponding cipher-text information is also all inequality, and the dot array data cipher-text information is associated with ISN.Above-mentioned encryption realizes that through AES said AES can be a symmetry algorithm.Above-mentioned AES can be EncData=AlgEnc (Key; Data).With this algorithm is example, and the Key in the above-mentioned algorithm can be second key, and Data can be a lattice information, through generating the dot array data cipher-text information after the above-mentioned algorithm computing.
Said identifying code generation module 13 can be encrypted second key and generate identifying code to said dot array data cipher-text information, also can be with the combined ciphering generation identifying code of second key to said internal code information and said dot array data cipher-text information.Said identifying code also can be a kind of MAC sign indicating number.Said second key can be same key with said first key, also can be different.Said second key can also be the said secondary key that disperses computing to generate to internal code information.With the combined ciphering generation identifying code of second key to said dot array data cipher-text information or said internal code information and said dot array data cipher-text information; The encryption here realizes that through the identifying code generating algorithm said identifying code generating algorithm can generate the raw data of random length the authorization information of regular length; And any bit of raw data is modified, and authorization information will be different.The identifying code generating algorithm can be MACData=AlgMAC (Key; Data), be example with this algorithm, the Key in the above-mentioned identifying code generating algorithm can be second key, Data can be the dot array data cipher-text information, through generating check code after the computing of above-mentioned identifying code generating algorithm; Key in the above-mentioned identifying code generating algorithm can also be second key, and Data can be the combination of said internal code information and said dot array data cipher-text information, through generating check code after the computing of above-mentioned identifying code generating algorithm.
From the above, the embodiment of the invention effectively improves the confidentiality of character library through a kind of encryption device of character library is provided.
With reference to Fig. 6, another embodiment of the present invention, the encryption device 10 based on the foregoing description character library further comprises:
Identifying code memory module 14 is stored said identifying code;
Whether the identifying code that said identifying code memory module 14 storages generate is used to check the internal code information of character library and lattice information to be distorted in the storer of device interior.
With second key is that the secondary key that said internal code information was generated is an example, and details are as follows to present embodiment:
Secondary key generation module 11 is used for that first key is carried out cryptographic calculation to each internal code information of character library and generates secondary key; Lattice information encrypting module 12 is used for successively the secondary key that is generated pair encrypted with the pairing lattice information of internal code information and generates the dot array data cipher-text information; Identifying code generation module 13 carries out cryptographic calculation with said secondary key pair and the pairing data cipher-text information of said secondary key respectively and generates identifying code; Identifying code memory module 14 is stored said identifying code successively.
Following is that same key is an example with second key and first key then, and details are as follows to present embodiment:
Secondary key generation module 11 disperses computing to generate secondary key to each internal code information in the character library first key; Lattice information encrypting module 12 is used the secondary key that generated pair to encrypt with the pairing lattice information of internal code information successively and is generated the dot array data cipher-text information; Identifying code generation module 13 carries out cryptographic calculation generation identifying code with first key to all said internal code informations and dot array data cipher-text information; Identifying code memory module 14 is stored said identifying code.
With reference to Fig. 7, another embodiment of the present invention also comprises identifying code inspection module 15 based on the foregoing description on the basis of the foregoing description, be used for said identifying code is tested.
With reference to Fig. 8, as one embodiment of the present of invention, said identifying code inspection module 15 comprises:
Check code cryptographic calculation unit 151 is used for the combined ciphering generation cryptographic calculation generation check code of said second key to said dot array data cipher-text information or said dot array data cipher-text information and said internal code information;
Comparing unit 152 is used for more said check code and identifying code;
Assay processing unit 153 is used for handling subsequent operation according to the comparative result of said check code and identifying code, and said check code is that identical then the continuation carried out subsequent operation with the comparative result of identifying code, otherwise returns mistake.
Said inspection module 15 is used for the combined ciphering generation check code of said second key to said dot array data cipher-text information or said internal code information and said dot array data cipher-text information, and said check code also can be a kind of MAC sign indicating number.The encryption here realizes through above-mentioned identifying code generating algorithm.As one embodiment of the present of invention; After generating check code after the above-mentioned identifying code generating algorithm of the combination process computing of check code cryptographic calculation unit 151 with said second key and said dot array data cipher-text information or said internal code information and said dot array data cipher-text information; Comparing unit 152 more said check codes and above-mentioned identifying code; Continue to carry out subsequent operation if the result is identical assay processing unit 153, otherwise return mistake.
Following is that the secondary key that said internal code information was generated is an example with second key still, and details are as follows to present embodiment:
Secondary key generation module 11 is used for disperseing computing to generate secondary key to each internal code information of character library first key; Lattice information encrypting module 12 is encrypted the pairing lattice information of secondary key that is generated pair and internal code information successively and is generated the dot array data cipher-text information; Identifying code generation module 13 is used for that respectively said secondary key pair is carried out cryptographic calculation with the pairing data cipher-text information of said secondary key and generates identifying code; Identifying code memory module 14 is stored said identifying code successively.Launch character library, check code cryptographic calculation unit 151 is used for that respectively said secondary key pair is carried out cryptographic calculation with the pairing data cipher-text information of said secondary key and generates check code; Comparing unit 152 is used for the more said successively check code identifying code corresponding with said check code; Assay processing unit 153 is used for handling subsequent operation according to the comparative result of said check code and identifying code, and said check code is that identical then the continuation carried out subsequent operation with the comparative result of identifying code, otherwise returns mistake.
Following is that same key is an example with second key and first key then, and details are as follows to present embodiment:
Secondary key generation module 11 is used for that first key is carried out cryptographic calculation to each internal code information of character library and disperses computing to generate secondary key; Lattice information encrypting module 12 is encrypted the pairing lattice information of secondary key that is generated pair and internal code information successively and is generated the dot array data cipher-text information; Identifying code generation module 13 is used for that first key is carried out cryptographic calculation to all said internal code informations and all said dot array data cipher-text information and generates identifying code; Identifying code storage unit 14 is stored said identifying code.Launch character library, check code cryptographic calculation unit 151 is used for that first key is carried out cryptographic calculation to all said internal code informations and all said dot array data cipher-text information and generates check code; Comparing unit 152 is used for more said check code and said identifying code; Assay processing unit 153 is used for handling subsequent operation according to the comparative result of said check code and identifying code, and said check code is that identical then the continuation carried out subsequent operation with the comparative result of identifying code, otherwise returns mistake.
By above-mentioned passable, the embodiment of the invention through a kind of encryption verification device of character library is provided, can after the illegal users from replacing character library, remind the user, thereby the confidentiality of lifting character library further reaches anti-tamper purpose.
The above is merely the preferred embodiments of the present invention; Be not so limit claim of the present invention; Every equivalent structure or equivalent flow process conversion that utilizes instructions of the present invention and accompanying drawing content to be done; Or directly or indirectly be used in other relevant technical fields, all in like manner be included in the scope of patent protection of the present invention.