Background technology
The encryption method that adopts mainly is divided into two big class, i.e. softdog mode and key floppy disc modes at present.
Softdog is present popular a kind of Encryption Tool.It comprises the hardware that is installed on parallel port of computer or the USB mouth, and a cover is applicable to the interface software and the tool software of various language.Softdog generally all have tens or the nonvolatile storage space of hundreds of byte can be for read-write, the inside that has has also increased a single-chip microcomputer.By writing a given data to parallel port (or USB interface), the judgement code data correctness that (or USB interface) returned from the parallel port checks whether softdog exists during running software.This mode is difficult for being deciphered firmly, thereby has the reliable advantage of encryption.But its shortcoming is, because various softdogs are reading the user when buying software, need to buy and the supporting dongle of this software simultaneously, if bought the software of several band softdogs simultaneously, then need when using different software or changing computing machine, change and the supporting dongle of used software, so not only increased a lot of troubles, and improved user's use cost to the user.
So-called key floppy disc mode is exactly that encrypted message is kept in a kind of software disc that is difficult to be replicated, and software is wanted these information of verification when operation.This floppy disk just looks like that a key is the same, so be called key floppy disc by people's custom.It also is present popular a kind of Encryption Tool.The user passes through key floppy disc is inserted computer floppy drive, thereby whether the identity of software verification encrypted message inspection user is legal.This kind mode is encrypted easy, and cost is low, and the user is easy to use.But this kind mode exists a big defective easily to be deciphered firmly, is just easily generated identical key floppy disc by illegal person and sells as legal, and disc may occur and cause information dropout finally to cause the out of use problem of key floppy disc because of often using to wear and tear.
About cryptographic algorithm
Cryptographic algorithm mainly is divided into two classes, i.e. symmetric encipherment algorithm (Symmetric Algorithm) and rivest, shamir, adelman (Asymmetric Algorithm), and the latter's security performance is better.
Rivest, shamir, adelman needs two keys: PKI (public key) and private key (private key), and PKI and private key are a pair of, if with PKI data are encrypted, have only with corresponding private key and could decipher; If data are encrypted, have only so with corresponding public-key cryptography and could decipher with private key.Because what encryption and decryption were used is two different keys, so this algorithm is called rivest, shamir, adelman.Utilize this specific character of asymmetric encryption, can utilize disclosed PKI that file is encrypted, just have only those people that know corresponding private key to be decrypted like this under the normal condition this document.Rivest, shamir, adelman has multiple, comprise DSA, Diffie-Hellman, RSA Algorithm etc., wherein RSA Algorithm is more representational a kind of, and this algorithm is based on the PKI system that big number can not be decomposed hypothesis by prime number, simply says to be exactly to look for two very big prime numbers.This cryptographic means is that the higher financial rank of a kind of Cipher Strength is encrypted.
Existing cryptographic algorithm is mainly used in the safety verification that guarantees network, but does not also have a kind of scheme to be used for the protection of software license.
About digital certificate
Digital certificate is a series of data of sign subscriber identity information, is used for discerning user's identity.Digital certificate is that the third-party institution by authenticating authority is that sign and issue at CA (Certification Authority) center, the encryption technology that with the digital certificate is core can be carried out encryption and decryption, digital signature and signature verification to information, guarantee confidentiality, the integrality of information, and the authenticity of transaction entity identities, the non-repudiation of signing messages, thus the security of using ensured.
Digital certificate adopts above-mentioned public-key cryptosystem, promptly utilizes a pair of key that matches each other to encrypt, decipher.Each user has one and only is the private cipher key (private key) that I grasped, and is decrypted and signs with it; Have a public keys (PKI) simultaneously and also can externally disclose, be used for encrypting and certifying signature.In public-key encryptosystem, commonly used a kind of be the RSA system.The form of digital certificate generally adopts X.509 international standard.
Embodiment
Below in conjunction with accompanying drawing the specific embodiment of the present invention is described in detail.
Fig. 1 is according to the process flow diagram that software license is carried out the method for encipherment protection of the present invention.Among the figure, method provided by the present invention comprises step:
A) generate user key to (User keypair), client public key (Public Key) and the private key for user (Private Key) of this user key to comprising mutual correspondence, the described private key for user that generates to the major general leaves in the memory storage, described private key for user and described memory storage are unique correspondences, and the private key for user in the described memory storage is not reproducible;
C) information with client public key is included in the software;
D) during running software, read the information of the described client public key in this software, and whether be the described memory storage that comprises this private key for user according to the Information Authentication memory storage of this client public key.
The fundamental characteristics of described memory storage is, can store data, only can this memory storage inter-process should storage data, and can prevent that external unit from duplicating these data.Described memory storage can be can be by the existing device that can satisfy above-mentioned condition of serial ports of computers, parallel port or the connection of USB mouth, for example IC-card, be embedded in the specific hardware in PDA(Personal Digital Assistant) or the computing machine, and can adopt USBKey, perhaps the internal circuit memory storage that interface is different with USBKey is identical under the preferable case.
Fig. 2 is a kind of performing step according to the step a) of preferred implementation of the present invention.
At step a1, earlier generate pair of secret keys (promptly described " user key to ") by computing machine in the memory storage outside, this key is to comprising private key for user and client public key.Generate the right method of this key and can utilize existing popular cryptographic algorithm, for example RSA (Rivest-Shamir-Adleman) algorithm etc.;
At step a2, the private key for user that generates to the major general imports in the memory storage;
At step a3, the private key for user outside the described memory storage is destroyed, to guarantee the uniqueness of this private key.
For above-mentioned steps a2, for the private key for user of guaranteeing to import in the described memory storage can not deleted easily, can increase the password login function for this memory storage, all need to input predefined password when promptly needing to use this memory storage; Perhaps in the preferred case, can directly described private key for user be solidificated in the described memory storage.
In these cases, only be that described private key for user leaves in the described memory storage, and, therefore can pass through means such as network download, Advise By Wire and obtain client public key because described client public key is disclosed.
Fig. 3 is the another kind of performing step according to the step a) of preferred implementation of the present invention.
At step a1 ', it is right to generate user key in memory storage, and described user key is to comprising private key for user and client public key;
At step a2 ', described client public key is taken out.
In these cases, private key and PKI are to be present in jointly in the described memory storage.Equally, not deleted for protecting this private key for user, can increase the password login function to this memory storage, and under the preferable case, can be to be solidificated in the described memory storage described private key for user.
So-called in the step a) " not reproducible " mainly comprises following four kinds of implications:
1) the memory storage duplicate instructions of response external not of the described private key for user of storage, for example " copy ", " read privateKey " or instructions such as " export privateKey ", this method has guaranteed that described private key for user can be by " soft not duplicating ";
2). by destructive means, the hardware configuration that is about to described memory storage carries out dismounting and can not duplicate described private key for user, and this method has guaranteed that described private key for user can " not duplicated " firmly;
3). utilize the client public key corresponding can not obtain this private key for user easily, promptly adopt the higher algorithm of security under the preferable case with this private key for user, " RSA " algorithm etc. for example, this method has guaranteed that described private key for user can be by " deciphering not be duplicated ".
4). described private key for user can only move in corresponding with it unique memory storage, can not be in the outside operation of described memory storage.
Under the preferable case, said method is used in combination, and will improve security greatly like this.Because above-mentioned technology all is known for those skilled in that art, therefore will no longer describe in detail here.
In addition, it will be appreciated that so-called " private key for user and described memory storage are unique correspondences " is meant that the memory storage that includes described private key for user is unique, the right to use of this private key for user only shifts with the transfer of this memory storage.For guaranteeing that this stores the uniqueness of the memory storage of described private key for user, can exercise supervision by the software developer when making this private key for user, software developer described here can be one or more.
For step c), " software " described here is sensu lato software, not merely refers to the kernel program that can realize a certain function that the developer develops, and also comprises message file that kernel program therewith is relevant etc.For example, generally, the developer can attach the relevant certificate of kernel program therewith on its kernel program, and therefore " software " described here is meant the set that comprises kernel program and some information relevant with this kernel program.Described client public key can be combined in this kernel program, also can be included in the out of Memory relevant with this kernel program, for example can be included in the certificate (being called " developer's certificate " here) that the developer provides.In addition, " client public key information " described here can refer to client public key itself, also can be the various distortion of client public key, and just can obtain described client public key itself by these distortion being carried out computing.According to the present invention, described client public key information and some software relevant informations (for example software license limit power of attorney) together can be left in " the developer's certificate " that the software developer provides.For increasing security, under normal conditions, the key that the software development chamber of commerce utilizes oneself is signed to this described client public key that bundles and software relevant information or " the developer's certificate " that include described public key information to " developer's private key " in (be called here " developer's key to "), like this during running software, need utilize disclosed " developer's PKI " that the information through " developer's private key " signature is authenticated, if authentication is passed through, then can obtain described client public key information and/or software relevant information, for example software use authority book.
In step d), as shown in Figure 4, when the checking memory storage whether be this when comprising the memory storage of private key for user, carry out the following step:
In step 130, the information of the client public key in the reading software;
In step 140, generate one group of random number x1, and the random number x1 that generates is sent to the memory storage that stores described private key for user;
In step 150, control described memory storage, utilize private key for user in this memory storage the random number x1 that receives to be signed and generate y1, and from described memory storage, read the data y1 of this signature generation in this memory storage inside;
In step 160, utilize described client public key that the data y1 that receives is verified that computing generates data x2;
In step 170, more original random data x1 and newly-generated data x2, if x1=x2, then checking is passed through, if inequality, then refusal passes through.
In addition, for being made more reliably, the uniqueness of the memory storage that stores described private key for user assert, can utilize the third party that described uniqueness is assert, thereby the user can confirm whether own employed private key for user has uniqueness by the uniqueness certificate of this process authenticating authority.Therefore, under the preferable case, the method that software license is carried out encipherment protection provided by the present invention further comprises step b), as shown in Figure 5.In step b), obtain the uniqueness certificate, this certificate is used for proving that the described private key for user corresponding with described client public key that is stored in described memory storage is unique.Obtaining of uniqueness certificate can be passed through the authoritative digital authenticating CA of mechanism (Certification Authority), this mechanism supervises the right generation of described user key, confirming that described private key for user is unique and the memory storage of storing this private key for user is unique at once with described private key for user, to the private key for user granting " uniqueness certificate " corresponding with this client public key.To " the uniqueness certificate " provided with the corresponding private key for user of client public key and general digital certificate is different, " uniqueness authentication " of the present invention is not to comprise the unique corresponding relation of PKI in proof " certificate request people " and the certificate, but " the unique property " of the private key for user in the described memory storage carried out authentication signature.Simultaneously, because described private key for user can not derived, therefore the use right of this private key also can only shift along with the transfer of described memory storage.The form of described " uniqueness certificate " can be any known digital certificate format, for example form X.509.This uniqueness certificate can leave in the described memory storage, also can obtain by means such as network download.Under the preferable case, this uniqueness certificate leaves in the described memory storage with described private key for user and client public key.
Under situation with uniqueness certificate, for step c), offer the private key for user that comprises described process " uniqueness " authentication in user's the memory storage at least, also can comprise " uniqueness certificate " that described client public key and/or authenticating authority center provide.What offer the software developer is not only described client public key, also has " the uniqueness certificate " that authenticate through authenticating authority mechanism.Many tame manufacturers can confirm the uniqueness of described private key for user according to this " uniqueness certificate ".
According to above-mentioned software license is carried out the method for encipherment protection, the invention provides a kind of system that software license is carried out encipherment protection.Described system comprises: user key is right, comprises the private key for user and the client public key of mutual correspondence, and the information of described client public key is included in the software; Memory storage is used for storing at least described private key for user, and described private key for user is unique, and described memory storage is unique corresponding with this private key for user, and the private key for user in the described memory storage is not reproducible; The private key for user authentication module, whether this authentication module is included in the software, is used for reading the information of the described client public key of this software, and be the described memory storage that comprises this private key for user according to this client public key checking memory storage.
Wherein, under the preferable case, described memory storage is USBKey, and described private key for user is solidificated among this USBKey, and described USBKey can further store described client public key.
Described private key for user authentication module is included in by the software developer in the software of being developed, and as shown in Figure 6, it comprises: the client public key reading unit is used for the client public key information that reading software comprises; The random number generation unit is used to generate one group of random number x1, and the random number x1 that generates is sent in the memory storage that stores described private key for user; The control reading unit, being used for control store has the storage unit of described private key for user, private key for user in this memory storage is signed to the random number x1 that receives in this memory storage inside generate y1, and from described memory storage, read the data y1 behind this signature; Authentication unit is used to utilize described client public key that the data y1 that receives is verified and generates data x2; And comparing unit is used for more original random data x1 and newly-generated data x2, if x1=x2 then by checking, otherwise finishes operation.
Under the preferable case, system provided by the invention further comprises the uniqueness certificate, and this uniqueness certificate is by the issue of authenticating authority mechanism, and it is used to prove that the private key for user of described client public key correspondence is unique.At this moment, can further comprise this uniqueness certificate in the described memory storage.
According to the method that software license is encrypted and protected provided by the invention; a kind of device that software license is encrypted and protected is provided; this device comprises storage unit and user key is right at least; client public key and the private key for user of described user key to comprising mutual correspondence; wherein; at least store described private key for user in the described storage unit, described private key for user and described memory storage are unique correspondences, and the private key for user in the described memory storage is not reproducible.
Under the preferable case, described storage unit is USBKey or the internal circuit memory device that interface is different with USBKey is identical.
Under the preferable case, described private key for user is solidificated in the described storage unit.
Under the preferable case, further comprise described client public key and/or uniqueness certificate in the described storage unit, described uniqueness certificate is used to prove that the private key for user of described client public key correspondence is unique.
Be described in detail to system according to the preferred embodiment of the present invention and through the course of work of the software of described client public key signature below in conjunction with Fig. 7.
When the user uses the software that the developer provides, earlier the described USBKey that is solidified with described private key for user is inserted in the USB interface of computer, at this moment, in step 100, the software that the software developer provides is at first checked its certificate of oneself providing, and promptly whether " developer's certificate " exists, if exist, then execution in step 110, otherwise end of run.
In step 110, the software that the developer provides utilizes, and described " developer's PKI " verified " the developer's certificate " that comprise described client public key information; As previously mentioned, because " developer's certificate " passed through the signature of developer " developer's private key " under normal conditions, therefore in step 120, the software that the developer provides can judge whether these data are to sign through the software developer, and whether content is through distorting.
If the verification passes, then execution in step 130, otherwise end of run.In step 130, software reads the client public key information that obtains through described " developer's PKI " checking, and in step 140, the random number generation unit in the private key for user authentication module generates a random data block x1, and this data block x 1 is sent to described memory storage; In step 150, the control reading unit in this authentication module is controlled described memory storage, private key for user in this memory storage is signed to the random number x1 that receives generate y1, and read the data y1 behind this signature from described memory storage; In step 160, the authentication unit in this private key for user authentication module utilizes described client public key that the data y1 that receives is verified that computing generates data x2; In step 170; random data x1 that comparing unit in this private key for user authentication module is more original and newly-generated data x2; if x1=x2; then execution in step 200; be the normal function of executive software,, illustrate that then described private key for user and client public key are not corresponding if x1 is not equal to x2; refuse the normal function of executive software this moment, thereby protected software.In addition, when using this to store the memory storage of described private key for user at least, can so just simplify operation, make things convenient for use without password authentification.
For above-mentioned operating procedure, step 100 is to 120 being steps that most of software developers usually adopt, so each developer can make amendment to these steps according to its needs.
It will be appreciated that; above-mentioned description is operational process according to the preferred embodiment of the present invention just; but be not limited to this process, modification and variation that any those skilled in that art make without creative work according to the present invention are included within protection scope of the present invention.