Embodiment
Referring to accompanying drawing, a kind of private server that is used to encrypt and encryption method, above method is will be packaged with in the process that expressly cipher-text information sends to receiving terminal at transmitting terminal to realize, comprise the password generation center, CPU and supporting memory cell and the short message receiving-transmitting unit that generate private key by software kit in the described server, concrete steps are as follows:
1., at first in the mailbox memory of server, set up master key by supporting fixedly algorithm;
2., obtain the request of private key and the sign of client, server carries out private key by master key and generates, and the private key that generates is issued to client safely, and client is the transmitting terminal or the receiving terminal of cipher-text information according to client;
3., transmitting terminal by the private key A that obtains and receiving terminal sign B with plain text encryption, encapsulate the back with transmitting terminal sign A and generate cipher-text information, be sent to receiving terminal;
4., receiving terminal is decrypted the cipher-text information that receives by private key B and the transmitting terminal sign A that obtains.If the transmitting terminal that successful decryption, receiving terminal obtain the plaintext of cipher-text information and can determine ciphertext really is A, if the deciphering failure can conclude that then cipher-text information pretends to be A to forge for other people or distorted.
Above-mentioned step 2. server is carried out the concrete grammar that private key distributes and is:
I. client is used the services password of client's sign, phone number and customer selecting server identification C encrypt to be sent to server and is asked.
Ii. after server uses the corresponding private key C deciphering of its sign, obtain client identification, phone number and services password.
Iii. server sends to a random number on client's mobile phone by note.
Iv. server generates client identification and corresponding private key with supporting algorithm and master key,
V. server derives from a symmetric key with the services password and the random number among the iii of supporting algorithm from ii.
Vi. server is issued to client with the symmetric key encryption private key that generates among supporting algorithm and the v.
Vii. client uses random number that the iii that receives on the services password selected among the i and the client's mobile phone sends to derive from symmetric key according to the method for v, and with this secret key decryption and store the private key that vi issues.
If transmitting terminal has obtained private key A, then directly carry out step 3., otherwise, at first carry out step 2., the services password that the transmitting terminal end identifies A and corresponding cell-phone number and selection with transmitting terminal is sent to server asks.
If receiving terminal has obtained private key B, then directly carry out step 4., otherwise, at first carry out step 2., the services password that receiving terminal identifies B and corresponding cell-phone number and selection with receiving terminal is sent to server asks.
When transmitting terminal is encrypted each cleartext information, come encrypting plaintext with using a unique number to mix the secret that calculates by private key A and sign B.Described unique number can be the cumulative number of current transmission ciphertext between transmitting terminal and the receiving terminal, and transmitting terminal adds 1 each the encryption to behind the receiving terminal of appointment with this counting, and receiving terminal compares the counting in local counting and the cipher-text information at every turn after successfully deciphering.If the counting in the cipher-text information is counted greater than this locality, the local counting of then receiving and deciphering result, and renewal is the counting in the cipher-text information.Described unique number also can be a random number by the transmitting terminal generation.In this case, receiving terminal need not record and this information relatively.
Above-mentioned sign A or sign B are the phone number or the user ID registered mistake, that authorize of transmitting terminal or receiving terminal.
Utilize above said fixedly algorithm to set up master key, distribute the process of private key and encryption and decryption to be:
1, at first sets up also initialization system.Generate center generation system parameter and master key by key.
1-1), key generates the center and at first generates relevant open system parameters.Comprise: be defined in a territory FpElliptic curve (or hyperelliptic curve) E on (p is that the power of a prime number or prime number is taken advantage of); Two point group: G on the curve1(power is the q cyclic group), point group G2(rank are the group of q); One can be calculated Homomorphic Mapping: G2→ G1On the curve one can calculate to as: Tate is right, Ate to or the Weil equity; A function H who message is embedded into curve1(this function can be with any message maps point group G to the curve2In, its computational methods and G2Expression way relevant [VS07]); The unique several generating modes of Password Operations: as cryptographic operation numeration (as the numeration of the encryption number of times between transmit leg and recipient) or random number; Cipher key derivation function KDF[ISO18033-2]; Mechanism of Data Encapsulation Ω [ISO18033-2].
1-2), key generates the center and at first generates master key: promptly select a random number s between [0, q-1] as master key.At G1In select a generator P at random1, announce P simultaneously1[s] P1Part for system parameters.
2, after key generation center is set up,
2-1), the user is to the private key of corresponding its sign of key generation center application ID.
A, user select a services password P, adopt mark encryption algorithm such as the BF-IBE algorithm for encryption services password and the subscriber phone number of standard.The recipient who encrypts generates center SMS module number for key.
B, key generation center use its SMS module number as the corresponding private key decoding request of sign, obtain user's services password P and phone number.
C, key generate random number R of center picked at random, send to user mobile phone by SMS module.
D, key generation center use cipher key derivation function KDF to derive from a key W from P and R.
2-2), cryptocenter will identify ID employing message imbedding function H1 and sign will be mapped to the point group G that selects in (1)2In some QID=H1(ID), calculate the private key d of corresponding sign againID=[s] QID.
2-3), key generates the center and will identify after private key adopts W to identify private key as key and Mechanism of Data Encapsulation Ω encrypting user, sends to the user of application.
2-4), the user after obtaining sign private key ciphertext and comprising the note of random number R, derive key W according to KDF, then according to Mechanism of Data Encapsulation Ω, deciphering sign private key dIDCan verify the correctness of private key in the following way: judge e (P1, QID) whether equal e ([s] P1, dID).If not etc., private key mistake then.
3, after getting access to the sign private key, the user just can adopt the cryptographic algorithm encrypting messages to give the recipient of appointment.
3-1), transmit leg calculates earlier and has only transmit leg and receive the shared secret that can generate just now.The steps include:
3-1a), the recipient is identified recipient IDRUse message imbedding function H1Be mapped to G2In a some QR=H1(IDR).
3-1b), transmit leg utilizes its private key d
SAnd Q
RCalculate shared secret
Transmit leg also can calculate
3-2), transmit leg is determined and unique several U of this time encryption.This number need can be random number or the encryption number of times register of selecting from a large space in each all differences of encrypting.If U is the current encryption numeration between transmit leg and the recipient, then need upgrade U=U+1.
3-3), the shared secret that use to calculate of transmit leg, encrypt of the input of unique several U and recipient sign, session key K as cipher key derivation function KDF at every turn.
3-4), transmit leg uses session key K and Mechanism of Data Encapsulation DEM encapsulation clear-text message m, generate encapsulation ciphertext C ← DEM (K, m).To encrypt unique several U, encapsulation ciphertext C and transmitting side marking IDSSend to the recipient as cipher-text information together.
4, the recipient carries out following operation and is decrypted after receiving cipher-text information:
If 4-1) unique several U is the encryption number of times numeration between transmit leg and recipient, the then relatively current encryption number of times numeration between U and transmit leg and the recipient.If U is less than or equal to current numeration, then end deciphering;
4-2), the recipient calculates and has only transmit leg and receive the shared secret that can generate just now.The steps include:
4-2a), with transmitting side marking recipient IDSUse message imbedding function H1Be mapped to G2In a some QS=H1(IDS).
4-2b), the recipient utilizes its private key d
RAnd Q
SCalculate shared secret
If transmit leg calculates
Then the recipient calculates
4-3), the recipient uses the shared secret of calculating, encrypts the input of unique several U and recipient sign as cipher key derivation function KDF, session key K.
4-4), the recipient uses the decapsulation mechanism in the Mechanism of Data Encapsulation, calculating output DEM-1(K, X) result.
If 4-5) successful decryption and to encrypt unique number be current encryption numeration between transmit leg and the recipient then need upgrade local current encryption number of times numeration and be U.
Now enumerate the detailed process that a specific embodiment further specifies client-requested private key in this method.
This encryption method can following equipment as: realize on smart card, mobile phone, USB device, the computer.Wherein smart card, USB device realize adding, deciphering at device interior, and the high security protection of private key is provided.Utilize the supporting algorithm of key encapsulation mechanism and Mechanism of Data Encapsulation to carry out combining encryption, be specially adapted to short message and encrypt.Be set forth in below and realize encrypted process on the mobile phone.
If realizing above method on the SIM card: need to install the STK that realizes above encrypting method on user's the SIM card and use.
1), user's (transmitting terminal or receiving terminal) selects application to open cryptographic services by the STK menu.After STK application requirements user imports a services password, adopt the mark encryption algorithm such as the BF-IBE algorithm for encryption services password of standard.The recipient who encrypts is designated key and generates center SMS module number.Send this cipher-text information after encryption is finished and generate the center SMS module to key.
2), after password generates the center SMS module and receive this encryptions note, use the private key of its note number correspondence to decipher, obtain services password, obtain user's phone number simultaneously by note.
3), password generation center selects the random code of 6 characters, send on the user mobile phone by note.Password generates the center according to the KDF that realizes services password and key W of random code derivation from the user.
4), after password generates the center and generate the sign private key of respective user phone number according to the sign private key generating algorithm that realizes, use W as key and data encapsulation algorithm for encryption sign private key.Password generation center will identify the private key ciphertext by SMS module and send to user mobile phone with messaging format.
5), SIM card after receiving note, the STK application requirements user of encrypting method imports 1) services password and 3 determined) after the random code sent, according to KDF derivative key W, deciphering sign private key ciphertext is recovered and the storaging mark private key.
6), the user will send when encrypting note, start the encryption note menu of STK menu, after the user imports recipient's phone number and short message content, STK use 5) the sign private key that obtains in and recipient's note number send to recipient's mobile phone with ciphertext by note after encrypting short message content according to aforesaid ciphering process.
When 7), the user wants the enabling decryption of encrypted note, start the deciphering note menu of STK menu, STK use 5) the sign private key that obtains in and sender's phone number are according to aforesaid decrypting process deciphering short message content, if successful decryption then shows short message content and sender's phone number.If failure then points out user's note system to forge or altered.