A kind of encryption and decryption method based on dynamic password
Technical field
The present invention relates to AES field, particularly to utilizing the disposable of dynamic password and time synchronizing characteristics to letter
The method that breath encrypts and decrypts.
Background technology
The quantum communications of legend perfectly solve the safety problem in communication transmission process, and following communication will more come
The safest and reliable.
But, in the common computer user using legacy network and mobile subscriber.Or exist by the attack of hacker
Risk.For the information of some need for confidentiality, prevent from stealing the most critically important.If the important informations such as some passwords are stolen, meeting
The property of people is brought huge loss.
Summary of the invention
It is an object of the invention to provide a kind of encryption and decryption method based on dynamic password, by many group dynamic passwords pair
Information is encrypted, deciphers.
The technical scheme is that a kind of encryption method based on dynamic password, information content is implemented by AES
Encryption, forms the first ciphertext;
The first dynamic password in first ciphertext and the first dynamic password token forms the by the first cryptographic calculation formula operation
Two ciphertexts;
The computing by the second cryptographic calculation formula of the second dynamic password in first dynamic password and the second dynamic password token
Formed in plain text;
In plain text with the second ciphertext composition cipher text, in each step ciphering process, when all including encryption, use dynamic password
Concrete temporal information, cipher text and temporal information composing document information;
The numerical value of the ciphertext dynamic password that ciphertext dynamic password token generates is used in selecting file information and numerical value equal amount
Bit number, and generate one section of bit code;Record the time that bit code generates;And record ciphertext dynamic password generate time
Between;
Random dynamic puzzle token generates random dynamic puzzle, the numerical value shown according to random dynamic puzzle, generates one section of mess code,
The numerical value that the bit number of mess code shows equal to random dynamic puzzle;And record the time that random dynamic puzzle generates;
After generating one section of bit code, automatically generating after one section of mess code is connected to bit code, many group bit code combine before and after mess code,
Complete to fileinfo whole choose after, form message information to be sent;
A kind of decryption method based on dynamic password, determines putting in order of bit code and mess code;
The time generated according to ciphertext dynamic password and random dynamic puzzle, decryption terminal is searched ciphertext in the corresponding time and moves
The ciphertext dynamic password of state cipher token and the concrete numerical value of the random dynamic puzzle of random dynamic puzzle token;
According to numerical value, message information is carried out classification searching, mess code information is deleted, restore the letter of the file after encryption
Breath;
During being decrypted cipher text, according to temporal information, decryption terminal equipment is transferred out and encryption from memorizer
Second dynamic password of synchronized update in terminal unit;
After to reversely deciphering computing in plain text, draw the value of the first dynamic password;
And the second ciphertext is deciphered according to the value of the first dynamic password, reduces, obtain the first ciphertext;Decryption terminal equipment synchronizes
The first dynamic password updated, plays checking, the effect of verification;
AES for the first ciphertext is decrypted, and restores original information content.
Further, after generating one section of bit code or one section of mess code, automated randomized generation one in the dynamic token of position
Serial number, carries out name placement according to the numerical value of serial number to bit code or mess code;The most forward, really by the least sequence of digital value
Determine the clooating sequence of bit code and mess code.
Further, by ciphertext dynamic password token and mess code dynamic password token to message information computing again, can
To generate new message information, calculating process can be once or repeatedly;The ciphertext dynamic password token used and mess code
Dynamic password token can be same, it is also possible to is other ciphertext dynamic password token and mess code dynamic password token.
Further, dynamic password token automatically generates a dynamic password at set intervals, and this time span is with the second
For ultimate unit;Dynamic token is respectively stored in ciphering terminal and decryption terminal, and synchronized update runs.
Further, dynamic password token is integrated with message information runs within one device.
Further, the original text of fileinfo can directly be entered by ciphertext dynamic password token and random dynamic puzzle token
Row encryption.
Further, the numerical value of ciphertext dynamic password in the selecting file information with the bit number of numerical value equal amount
Group, each group of bit number is made up of multiple bit informations.
Further, AES includes: symmetry encryption algorithm and unsymmetrical tridiagonal matrix algorithm.
Further, mess code is the irregular stochastic and dynamic code of stochastic generation.
In embodiments of the present invention: by the dynamic password in multiple dynamic password tokens, information realization encryption is conciliate
Close, in this process.Dynamic password and token are respectively stored in ciphering terminal and decryption terminal, are not involved in transmission.Pass through
In fileinfo, insert reducible mess code, when information is transmitted, automatically information has been carried out change and has upset.
Accompanying drawing explanation
For the technical scheme being illustrated more clearly that in the embodiment of the present invention, in embodiment being described below required for make
Accompanying drawing be briefly described, it should be apparent that, below describe in accompanying drawing be only some embodiments of the present invention, for
From the point of view of those of ordinary skill in the art, on the premise of not paying creative work, it is also possible to obtain other according to these accompanying drawings
Accompanying drawing.
Fig. 1 is the flow chart of a kind of based on dynamic password the encryption method that the embodiment of the present invention is introduced from terminal point.
Fig. 2 is the flow chart of a kind of based on dynamic password the decryption method that the embodiment of the present invention is introduced from terminal point.
Fig. 3 is the flow chart of a kind of based on dynamic password the encryption method that the embodiment of the present invention is introduced from terminal point.
Fig. 4 is the flow chart of a kind of based on dynamic password the encryption method that the embodiment of the present invention is introduced from terminal point.
Detailed description of the invention
In order to make those skilled in the art be more fully understood that the present invention program, below in conjunction with in the embodiment of the present invention
Accompanying drawing, is clearly and completely described the technical scheme in the embodiment of the present invention, it is clear that described embodiment is only
The embodiment of a present invention part rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people
The every other embodiment that member is obtained under not making creative work premise, all should belong to the model of present invention protection
Enclose.
As it is shown in figure 1, a kind of encryption method based on dynamic password, it is characterised in that by multiple dynamic password tokens
Dynamic password realize encryption to information, described method includes:
Information content is implemented encryption by S11 AES, forms the first ciphertext;
S12 the first ciphertext is formed by the first cryptographic calculation formula operation with the first dynamic password in the first dynamic password token
Second ciphertext;
The fortune by the second cryptographic calculation formula of the second dynamic password in S13 the first dynamic password and the second dynamic password token
Calculate and formed in plain text;
S14 forms cipher text with the second ciphertext in plain text, in each step ciphering process, uses the closeest when all including encryption
The concrete temporal information of code, cipher text and temporal information composing document information;
The numerical value of the ciphertext dynamic password that S15 ciphertext dynamic password token generates is used in selecting file information and numerical value equal numbers
The bit number of amount, and generate one section of bit code;Record the time that bit code generates;And record ciphertext dynamic password generate time
Between;
S16 random dynamic puzzle token generates random dynamic puzzle, the numerical value shown according to random dynamic puzzle, generates one section of unrest
Code, the numerical value that the bit number of mess code shows equal to random dynamic puzzle;And record the time that random dynamic puzzle generates;
S17 generates after one section of bit code, automatically generates after one section of mess code is connected to bit code, group before and after many group bit code and mess code
Close, complete to fileinfo whole choose after, form message information to be sent.
As in figure 2 it is shown, a kind of decryption method based on dynamic password, it is characterised in that by multiple dynamic password tokens
Dynamic password realize deciphering to information, described method includes:
S21 determines putting in order of bit code and mess code;
The time that S22 generates according to ciphertext dynamic password and random dynamic puzzle, search in the corresponding time close in decryption terminal
The ciphertext dynamic password of literary composition dynamic password token and the concrete numerical value of the random dynamic puzzle of random dynamic puzzle token;
S23, according to numerical value, carries out classification searching to message information, mess code information is deleted, restore the file after encryption
Information;
During cipher text is decrypted by S24, according to temporal information, decryption terminal equipment is transferred out from memorizer and adds
Second dynamic password of synchronized update in close terminal unit;
After S25 is by reversely deciphering computing to plaintext, draw the value of the first dynamic password;
Second ciphertext is deciphered, is reduced by S26 the value according to the first dynamic password, obtains the first ciphertext;In decryption terminal equipment
First dynamic password of synchronized update, plays checking, the effect of verification;
S27 is decrypted for the AES of the first ciphertext, restores original information content.
As it is shown on figure 3, S18 is after generating one section of bit code or one section of mess code, automated randomized generation in the dynamic token of position
One serial number, carries out name placement according to the numerical value of serial number to bit code or mess code;More leaned on by the least sequence of digital value
Before, determine the clooating sequence of bit code and mess code.
S19, can be generated message information computing again by ciphertext dynamic password token and mess code dynamic password token
New message information, calculating process can be once or repeatedly;The ciphertext dynamic password token used and mess code are the closeest
Code token can be same, it is also possible to is other ciphertext dynamic password token and mess code dynamic password token.
As shown in Figure 4, S101 dynamic password token automatically generates a dynamic password, this time span at set intervals
With the second as ultimate unit;Dynamic token is respectively stored in ciphering terminal and decryption terminal, and synchronized update runs.
S102 dynamic password token is integrated with message information to be run within one device.
The original text of fileinfo can directly be added by S103 ciphertext dynamic password token and random dynamic puzzle token
Close.
The numerical value of S104 ciphertext dynamic password is used for the bit array in selecting file information with numerical value equal amount, each
Group bit number is made up of multiple bit informations.
S105 AES includes: symmetry encryption algorithm and unsymmetrical tridiagonal matrix algorithm.
S106 mess code is the irregular stochastic and dynamic code of stochastic generation.