CN109787764A - A kind of encryption method based on cipher key delivery equipment - Google Patents
A kind of encryption method based on cipher key delivery equipment Download PDFInfo
- Publication number
- CN109787764A CN109787764A CN201910227532.1A CN201910227532A CN109787764A CN 109787764 A CN109787764 A CN 109787764A CN 201910227532 A CN201910227532 A CN 201910227532A CN 109787764 A CN109787764 A CN 109787764A
- Authority
- CN
- China
- Prior art keywords
- byte
- key
- ciphertext
- data
- temp
- 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.)
- Granted
Links
Landscapes
- Mobile Radio Communication Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention relates to a kind of encryption methods based on cipher key delivery equipment, specifically includes the following steps: step 1: generating X group foundation key K0, generate an integer A, divide exactly X remainder to A, remainder B selects foundation key K0 by remainder BBTransmission key K1 is encrypted and generates ciphertext Y1;Step 2: selecting different encryption methods to generate ciphertext Y2 to operation key K2 encryption according to the parity of the first character section of transmission key K1;Step 3: ciphertext Y1 and ciphertext Y2 carries out XOR operation, obtains ciphertext Y3;Step 4: by handling integer A, obtaining variable position data, select different assembling modes further according to the parity of position data, then carry out data encapsulation, finally obtain the data packet of key reception side to be transferred to;The present invention joined random perturbation data and transmission key, and ciphertext Data Position is discrete during key is generated with encrypting, and increases ciphertext and decodes difficulty.
Description
Technical field
The present invention relates to communication encryption technical field more particularly to a kind of encryption methods based on cipher key delivery equipment.
Background technique
As internet develops rapidly, more and more people like carrying out information interchange activity (such as network payment, language on the net
Sound chat, information browse etc.), therefore how to ensure that the safety of information transmission just embodies particularly important, and ensure these letters
The encryption method that the safety of breath has just needed.This encryption method introduces how to carry out encryption and decryption to data, by data encryption
Ensure information security, reduces the risk that enemy cracks encryption data.
Existing encryption method is broadly divided into symmetric cryptography and asymmet-ric encryption method, and the prior art has the drawback that
1, the ciphertext of existing encryption technology transmission is all useful data, does not have data diddling.
2, in existing symmetric encipherment algorithm, same data are the same by the ciphertext that encryption generates.Enemy intercepts and captures
According to multiple ciphertext data after ciphertext, regular statistics is carried out to ciphertext data, ciphertext data are analyzed, it is easy to complete to ciphertext number
According to decryption crack, thus increase the risk that ciphertext data crack.
3, in existing encryption technology, ciphertext data distribution position is fixed when cipher key delivery, for example data A divides always
Cloth is distributed in fixed 36 to 47 byte of position in fixed 2 to 32 byte of position, data B always, and which improves ciphertexts to crack
Probability.
Summary of the invention
The technical problems to be solved by the present invention are: in view of the above problems, providing one kind and being set based on cipher key delivery
Standby encryption method.
The technical solution adopted by the invention is as follows:
A kind of encryption method based on cipher key delivery equipment, the encryption method specifically includes the following steps:
Step 1: generating X group foundation key K0, respectively foundation key K00To foundation key K0X-1;Generate an integer
A divides exactly X remainder to A, and remainder B selects foundation key K0 by remainder BBTransmission key K1 is encrypted and generates ciphertext Y1, institute
Stating transmission key K1 is the useless key generated by random algorithm;
Step 2: different encryption methods pair is selected according to the parity of the first character section K1-byte0 of transmission key K1
It operates key K2 encryption and generates ciphertext Y2, operation key K2 is generated by key generator, and operation key K2 is key reception side
Required key data;
Step 3: XOR operation first being carried out to the M-1 byte to the B byte of ciphertext Y1, obtains operation result
Temp obtains ciphertext Y3 by carrying out XOR operation to operation result Temp, ciphertext Y1 and ciphertext Y2;
Step 4: by handling integer A, variable position data are obtained, further according to the surprise of position data
Idol selects different assembling modes, finally carries out data encapsulation, obtains the data packet of key reception side to be transferred to.
Further, the X group foundation key is stored in cipher key delivery side and key reception method, system;
The integer A is generated by random algorithm, and length is 4 bytes;
The foundation key K0, transmission key K1 are the data of M byte, the M > B.
Further, the M is 52.
Further, integer A divides exactly M complementation, obtains complementation result C;
It is described
0≤n≤M-1, n are the successively integer of value from zero to M-1.
Further, the step 2 specifically includes:
Step 21: the key generator of initiator generates operation key K2, the operation key according to system user demand
K2 is the data of M byte, and the byte number of ciphertext Y2 is 2*M;
Step 22: if the first character section K1-byte0 of transmission key K1 be odd number, operate key K2 ciphertext data according to
Secondary correspondence in the odd number bit byte of ciphertext Y2 data, filled in random data by the even bit byte data of ciphertext Y2;
If the first character section K1-byte0 of transmission key K1 is even number, operates key K2 ciphertext data and be corresponding in turn to
The odd bits byte data of the even number bit byte of ciphertext Y2 data, ciphertext Y2 is filled in random data.
Further, the transmission key K1 operation key K2 encryption generates ciphertext Y2's method particularly includes:
All odd number bit bytes of transmission key K1 are subjected to XOR operation and obtain result PIt is odd, by all of transmission key K1
Even number bit byte carries out XOR operation and obtains result PIt is even:
When M is even number:
When M is odd number:
If the first character section K1-byte0 of transmission key K1 be odd number, operate key K2 each byte respectively with PIt is oddInto
Row XOR operation, obtain operation each byte of key K2 encrypted cipher text, then by operate key K2 M byte cryptogram data according to
The corresponding odd bits of ciphertext Y2 are arrived in secondary storage, and the even bit of ciphertext Y2 inserts useless random data, are used for data diddling;
Ciphertext Y2 calculating process is as follows:
Y2-BYTE (2n)=any random number;0≤n≤M-1
If the first character section K1-byte0 of transmission key K1 be even number, operate key K2 each byte respectively with PIt is evenInto
Row XOR operation, obtain operation each byte of key K2 encrypted cipher text, then by operate key K2 N number of byte cryptogram data according to
The corresponding even bit of ciphertext Y2 is arrived in secondary storage, and the odd bits of ciphertext Y2 insert useless random data, is used for data diddling;
Ciphertext Y2 calculating process is as follows:
Y2-BYTE (2n+1)=any random number;0≤n≤M-1
Finally obtain ciphertext Y2.
Further, the step 3 method particularly includes:
The byte number of ciphertext Y3 is 2*M, until the M-1 byte of Y1 since the B byte of ciphertext Y1
XOR operation is carried out, result Temp is obtained, the B is the remainder B in step 1;
The specific calculating process of encrypted cipher text Y3 is as follows:
Further, the detailed process of the step 4 are as follows:
Integer A is moved to right into 8, then step-by-step and upper 0X000000FF, obtains variable position data, i.e. position=
(A>>8)&0X000000FF;If position is odd number, ciphertext data assembling sequence is followed successively by integer A, ciphertext Y1, ciphertext Y3,
If position is even number, ciphertext data assembling sequence is followed successively by integer A, ciphertext Y3, ciphertext Y1;
All data in ciphertext after checking assembling, are transformed into 2 syllable sequences for each byte 0X7E occurred in ciphertext
Column, if occurring the byte of 0X7D in ciphertext, are converted into 2 byte sequences, obtain ciphertext data Y3_temp;
The length of ciphertext data Y3_temp is calculated, length length_temp is finally encapsulated as the head of 2 bytes
The tail 0X7E 0X7E of 0X7E0X7E, total length of data length_all, the data ciphertext Y3_temp of 2 bytes and 2 bytes, most
The transport_Data data packet of key reception side to be transferred to is obtained afterwards, and the total length length_all includes 2 bytes
Head, the tails of 2 bytes, length length_temp and length_all itself length.
Compared with prior art, having the beneficial effect that by adopting the above technical scheme
(1) present invention joined random perturbation data and transmission key during key is generated with encrypting, and cause same
The ciphertext that one data encrypts generation every time is different, and the ciphertext that this programme encryption generates has data diddling, increases ciphertext
Decode difficulty.
(2) present invention ciphertext data distribution position after data encryption is discrete, the ciphertext data packet locations in data assembling
Also be not fixed, therefore there is ciphertext data distribution of the present invention discrete, position distribution the advantages such as to be not fixed, increase enemy decode it is close
The difficulty of code.
Detailed description of the invention
Bulk encryption method flow diagram Fig. 1 of the invention;
Fig. 2 is the encryption flow figure of step 1 in the embodiment of the present invention;
Fig. 3 is the encryption flow figure of step 2 in the embodiment of the present invention;
Fig. 4 is the encryption flow figure of step 3 in the embodiment of the present invention;
Fig. 5 is the data assembling flow chart of step 4 in the embodiment of the present invention.
Specific embodiment
All features disclosed in this specification or disclosed all methods or in the process the step of, in addition to mutually exclusive
Feature and/or step other than, can combine in any way.
Any feature disclosed in this specification unless specifically stated can be equivalent or with similar purpose by other
Alternative features are replaced.That is, unless specifically stated, each feature is an example in a series of equivalent or similar characteristics
?.
The present invention is described further with reference to the accompanying drawing.
As shown in Figure 1, a kind of encryption method based on cipher key delivery equipment, the encryption method specifically include following step
It is rapid:
Step 1: generating X group foundation key K0, respectively foundation key K00To foundation key K0X-1;Generate an integer
A divides exactly X remainder to A, and remainder B selects foundation key K0 by remainder BBTransmission key K1 is encrypted and generates ciphertext Y1, institute
Stating transmission key K1 is the useless key generated by random algorithm;
Step 2: different encryption methods pair is selected according to the parity of the first character section K1-byte0 of transmission key K1
It operates key K2 encryption and generates ciphertext Y2, operation key K2 is generated by key generator, and operation key K2 is key reception side
Required key data;
Step 3: XOR operation first being carried out to the M-1 byte to the B byte of ciphertext Y1, obtains operation result
Temp obtains ciphertext Y3 by carrying out XOR operation to operation result Temp, ciphertext Y1 and ciphertext Y2;
Step 4: by handling integer A, variable position data are obtained, further according to the surprise of position data
Idol selects different assembling modes, finally carries out data encapsulation, obtains the data packet of key reception side to be transferred to.
In a preferred embodiment, the X group foundation key is stored in cipher key delivery side and key reception method, system;
The integer A is generated by random algorithm, and length is 4 bytes;
The foundation key K0, transmission key K1 are the data of M byte, the M > B.
In a preferred embodiment, key generator 1 generates foundation key K0, and key generator 2 generates transmission key
K1, key generator 3 generate operation key K3, and K1 is useless key, and K1 is the key for confusing hostile;K2 is that recipient is true
The key just needed.It is different for different user K2, such as the features such as the length of K2 is different, data sense is different.
In a preferred embodiment, the M is 52.
In a preferred embodiment, integer A divides exactly M complementation, obtains complementation result C;
It is described
0≤n≤M-1, n are the successively integer of value from zero to M-1.
In a preferred embodiment, the step 2 specifically includes:
Step 21: the key generator of initiator generates operation key K2, the operation key according to system user demand
K2 is the data of M byte, and the byte number of ciphertext Y2 is 2*M;
Step 22: if the first character section K1-byte0 of transmission key K1 be odd number, operate key K2 ciphertext data according to
Secondary correspondence in the odd number bit byte of ciphertext Y2 data, filled in random data by the even bit byte data of ciphertext Y2;
If the first character section K1-byte0 of transmission key K1 is even number, operates key K2 ciphertext data and be corresponding in turn to
The odd bits byte data of the even number bit byte of ciphertext Y2 data, ciphertext Y2 is filled in random data.
In a preferred embodiment, the transmission key K1 operation key K2 encryption generates the specific method of ciphertext Y2
Are as follows:
All odd number bit bytes of transmission key K1 are subjected to XOR operation and obtain result PIt is odd, by all of transmission key K1
Even number bit byte carries out XOR operation and obtains result PIt is even:
When M is even number:
When M is odd number:
If the first character section K1-byte0 of transmission key K1 be odd number, operate key K2 each byte respectively with PIt is oddInto
Row XOR operation, obtain operation each byte of key K2 encrypted cipher text, then by operate key K2 M byte cryptogram data according to
The corresponding odd bits of ciphertext Y2 are arrived in secondary storage, and the even bit of ciphertext Y2 inserts useless random data, are used for data diddling;
Ciphertext Y2 calculating process is as follows:
Y2-BYTE (2n)=any random number;0≤n≤M-1
If the first character section K1-byte0 of transmission key K1 be even number, operate key K2 each byte respectively with PIt is evenInto
Row XOR operation, obtain operation each byte of key K2 encrypted cipher text, then by operate key K2 N number of byte cryptogram data according to
The corresponding even bit of ciphertext Y2 is arrived in secondary storage, and the odd bits of ciphertext Y2 insert useless random data, is used for data diddling;
Ciphertext Y2 calculating process is as follows:
Y2-BYTE (2n+1)=any random number;0≤n≤M-1
Finally obtain ciphertext Y2.
In a preferred embodiment, the step 3 method particularly includes:
The byte number of ciphertext Y3 is 2*M, until the M-1 byte of Y1 since the B byte of ciphertext Y1
XOR operation is carried out, result Temp is obtained, the B is the remainder B in step 1;
The specific calculating process of encrypted cipher text Y3 is as follows:
In a preferred embodiment, the detailed process of the step 4 are as follows:
Integer A is moved to right into 8, then step-by-step and upper 0X000000FF, obtains variable position data, i.e. position=
(A>>8)&0X000000FF;If position is odd number, ciphertext data assembling sequence is followed successively by integer A, ciphertext Y1, ciphertext Y3,
If position is even number, ciphertext data assembling sequence is followed successively by integer A, ciphertext Y3, ciphertext Y1;
All data in ciphertext after checking assembling, are transformed into 2 syllable sequences for each byte 0X7E occurred in ciphertext
Column, if occurring the byte of 0X7D in ciphertext, are converted into 2 byte sequences, obtain ciphertext data Y3_temp;
The length of ciphertext data Y3_temp is calculated, length length_temp is finally encapsulated as the head of 2 bytes
The tail 0X7E 0X7E of 0X7E0X7E, total length of data length_all, the data ciphertext Y3_temp of 2 bytes and 2 bytes, most
The transport_Data data packet of key reception side to be transferred to is obtained afterwards, and the total length length_all includes 2 bytes
Head, 2 bytes tail and length length_temp.The total length length_all include the head of 2 bytes, 2 bytes tail,
The length of length length_temp and length_all itself
In a preferred embodiment, as shown in Fig. 2, the detailed process of the step 1 are as follows:
Step 11: generating 10 groups of foundation key K0, be foundation key K0 respectively0To foundation key K09, this 10 groups bases
Key is all stored in cipher key delivery side and key reception method, system.Transmission key K1 is the useless key generated by algorithm,
K1 is the key for confusing hostile.System provides foundation key K0 and transmission key K1 is the data of 52 bytes.Certainly
Foundation key K0 and transmission key K1 is also possible to the data of other any bytes, so the data length of K0 and K1, which has, to be expanded
Malleability;
Step 12: utilizing random algorithm, generate the integer A that a length is 4 bytes, the data format of integer A such as table 1
It is shown, 10 remainders are divided exactly to A, remainder is B (B is the integer for being less than or equal to 9 more than or equal to 0), determines by B and uses K0BBase
Plinth key pair transmission key K1 carries out encryption and generates ciphertext Y1, and wherein Y1 is the ciphertext data of 52 bytes.The length of certain Y1
It is that Encryption Algorithm used by being encrypted according to the length and K0 of K0 and K1 design to K1 determines;
1 A data format of table
byte0-A | byte 1-A | byte 2-A | byte 3-A |
Step 13: completing K0BEncryption of the foundation key to transmission key K1 (deception key).K1 is to pass through key generator
52 bytes of random data generated, K0B, K1 and Y1 be all 52 bytes, data format is shown in Table 2, table 3 and table 4.Calculate A
Divide exactly 52 complementations to result C, (C is the integer for being less than or equal to 51 more than or equal to 0).By K0 to K1 computations, 52 are obtained
The ciphertext data Y1 of byte, circular are as follows:
(explanation: 0≤n≤51)
2 transmission key K1 data format of table
K1-byte0 | K1-byte 1 | K1-byte 2 | … | K1-byte 51 |
3 foundation key K0 of tableBData format
K0B-BYTE0 | K0B-BYTE1 | K0B-BYTE2 | … | K0B-BYTE51 |
4 ciphertext Y1 data format of table
Y1-BYTE0 | Y1-BYTE1 | Y1-BYTE2 | … | Y1-BYTE51 |
As shown in figure 3, the detailed process of the step 2 are as follows:
Step 21: operation key K2 is key data required for key reception side, in system all encryptions be all for
Operation key K2 is not cracked.System predetermined operation key K2 is 52 bytes, and operation key K2 is soft by key generator
Part generates.Operation key K2 is the key that key sender generates according to system user demand, the data format of transmission key K2
It is shown in Table 5.
Table 5 operates key K2 data format
K2-BYTE0 | K2-BYTE1 | K2-BYTE2 | … | K2-BYTE51 |
Step 22: according to transmission key K1 in step 13, ciphertext being generated to operation key K2 encryption by transmission key K1
Y2, transmission key K1, operation key K2 are 52 bytes, and Y2 is 104 byte cryptogram data, the specific following institute of ciphering process
It states.If the first character section K1-byte0 of transmission key K1 is odd number, the ciphertext data for operating key K2 encryption are successively right
It should be filled in the odd number bit byte of ciphertext Y2 data, even bit byte data with random data;If the of transmission key K1
One byte K1-byte0 is even number, then operates the corresponding even bit word in ciphertext Y2 data of ciphertext data of key K2 encryption
Section, odd bits byte data are filled in random data.It is mixed that this ciphertext mode of filling in intersects key data and hash
It closes, the ciphertext Y2 of generation has duplicity, very big being trapped rear key and cracking difficulty.Specific encryption method is as follows:
(a) all odd number bit bytes of transmission key K1 are carried out XOR operation and obtains result PIt is odd, transmission key K1's
All even number bit bytes carry out XOR operation and obtain result PIt is even,
If (b) the first character section K1-byte0 of transmission key K1 is odd number;
By operate key K2 each byte respectively with PIt is oddXOR operation is carried out, the operation each byte of key K2 is obtained
Encrypted cipher text, while 52 byte cryptogram data for operating key K2 successively being stored to the corresponding odd bits of ciphertext Y2.Ciphertext
The even bit of Y2 inserts useless random number, is used for data diddling.Ciphertext Y2 cryptogram computation process is as follows:
(explanation: 0≤n≤51)
Y2-BYTE (2m)=any random number;(explanation: 0≤m≤51)
If (c) the first character section K1-byte0 of transmission key K1 is even number;
By operate key K2 each byte respectively with PIt is evenXOR operation is carried out, the operation each byte of key K2 is obtained
Encrypted cipher text, while 52 byte cryptogram data for operating key K2 successively being stored to the corresponding even bit of ciphertext Y2.Ciphertext
The odd bits of Y2 insert useless random number, are used for data diddling.Y2 cryptogram computation process is as follows:
(explanation: 0≤n≤51)
Y2-BYTE (2m+1)=any random number;(explanation: 0≤m≤51)
(d) Y2 ciphertext data have been finally obtained by above-mentioned calculating
6 ciphertext Y2 data format of table
Y2-BYTE0 | Y2-BYTE1 | Y2-BYTE3 | … | Y2-BYTE103 |
As shown in figure 4, the detailed process of the step 3 are as follows:
By step 1 and step 2, we have obtained data A, and (the remainder B that A divides exactly 10 is current key recipient and key
Sender selects K0BFoundation key encrypts K1), ciphertext data Y1 and ciphertext data Y2 and transmission key K1 and behaviour
Make key K2.It completes ciphertext Y1 and final ciphertext Y3 is generated to ciphertext Y2 encryption, the data format of ciphertext Y3 is shown in Table 7, and ciphertext Y3 is
104 byte cryptogram data, it is as follows that ciphertext Y1 encrypts generation ciphertext Y3 process to ciphertext Y2:
7 ciphertext Y3 data format of table
Y3-BYTE0 | Y3-BYTE1 | Y3-BYTE3 | … | Y3-BYTE103 |
(a) the remainder B obtained according to step 12;
(b) until the 51st byte progress XOR operation of ciphertext Y1, is tied since the B byte of ciphertext Y1
Fruit Temp,
(c) by computations, ciphertext Y3 is obtained, the calculating process of ciphertext Y3 is as follows:
(explanation: 0≤n≤51)
(explanation: 52≤m≤103)
As shown in figure 5, the detailed process of the step 4 are as follows:
Step 41: 1, step 2 and step 3 through the above steps, obtained integer A, ciphertext data Y1, ciphertext data Y2 and
Ciphertext data Y3.
Step 42: data A is moved to right into 8 step-by-step and upper 0X000000FF again, obtains variable position data,
(A > > 8) &0X000000FF, when position is odd number, then message data assembling result is followed successively by integer A, close to position=
Literary Y1, ciphertext Y3, are shown in Table 8.When position is even number, then message data assembling result is followed successively by integer A, ciphertext Y3, ciphertext
Y1 is shown in Table 9.
Format after message assembling when 8 position of table is odd number
Format after message assembling when 9 position of table is even number
Step 43: data encapsulation checks all data in Fig. 2 Fig. 3 message, each byte that will occur in message
0X7E is transformed into 2 byte sequences (0X7D, 0X5E);If occurring the byte of a 0X7D in message data, it is converted into 2 words
It saves sequence (0X7D, 0X5D).Obtain message data Y3_temp.
Step 44: calculating message data Y3_temp length is length_temp, and final encapsulation is the head of two bytes
The tail 0X7E 0X7E of 0X7E0X7E, total length of data length_all, the data Y3_temp of two bytes and two bytes.Most
The transport_Data data packet of key reception side to be transferred to is obtained afterwards.The total length length_all includes 2 bytes
Head, the tails of 2 bytes, length length_temp and length_all itself length
The invention is not limited to specific embodiments above-mentioned.The present invention, which expands to, any in the present specification to be disclosed
New feature or any new combination, and disclose any new method or process the step of or any new combination.If this
Field technical staff is altered or modified not departing from the unsubstantiality that spirit of the invention is done, should belong to power of the present invention
The claimed range of benefit.
Claims (8)
1. a kind of encryption method based on cipher key delivery equipment, it is characterised in that: the encryption method specifically includes the following steps:
Step 1: generating X group foundation key K0, respectively foundation key K00To foundation key K0X-1;An integer A is generated, to A
Divide exactly X remainder, remainder B selects foundation key K0 by remainder BBTransmission key K1 is encrypted and generates ciphertext Y1, the transmission
Key K1 is the useless key generated by random algorithm;
Step 2: selecting different encryption methods to operation according to the parity of the first character section K1-byte0 of transmission key K1
Key K2 encryption generates ciphertext Y2, and operation key K2 is generated by key generator, and operation key K2 is needed for key reception side
The key data wanted;
Step 3: XOR operation first being carried out to the M-1 byte to the B byte of ciphertext Y1, operation result Temp is obtained, leads to
It crosses and XOR operation is carried out to operation result Temp, ciphertext Y1 and ciphertext Y2, obtain ciphertext Y3;
Step 4: by handling integer A, variable position data are obtained, further according to the parity of position data
Different assembling modes is selected, data encapsulation is finally carried out, obtains the data packet of key reception side to be transferred to.
2. a kind of encryption method based on cipher key delivery equipment as described in claim 1, it is characterised in that:
The X group foundation key is stored in cipher key delivery side and key reception method, system;
The integer A is generated by random algorithm, and length is 4 bytes;
The foundation key K0, transmission key K1 are the data of M byte, the M > B.
3. a kind of encryption method based on cipher key delivery equipment as claimed in claim 2, it is characterised in that: the M is 52.
4. a kind of encryption method based on cipher key delivery equipment as claimed in claim 2, it is characterised in that: specific computations
Method are as follows:
Integer A divides exactly M complementation, obtains complementation result C;
Y1-BYTE (n)=(K0B-BYTE(0)⊕K0B-BYTE(1)⊕…K0B-BYTE(C))⊕K1-byte(n);0≤the n
≤ M-1, n are the successively integer of value from zero to M-1.
5. a kind of encryption method based on cipher key delivery equipment as described in claim 1, it is characterised in that:
The step 2 specifically includes:
Step 21: the key generator of initiator generates operation key K2 according to system user demand, and the operation key K2 is M
The data of a byte, the byte number of ciphertext Y2 are 2*M;
Step 22: if the first character section K1-byte0 of transmission key K1 is odd number, it is successively right to operate key K2 ciphertext data
It should be filled in the odd number bit byte of ciphertext Y2 data, the even bit byte data of ciphertext Y2 with random data;
If the first character section K1-byte0 of transmission key K1 is even number, operates key K2 ciphertext data and be corresponding in turn in ciphertext
The odd bits byte data of the even number bit byte of Y2 data, ciphertext Y2 is filled in random data.
6. a kind of encryption method based on cipher key delivery equipment as claimed in claim 5, it is characterised in that: the transmission key
K1 generates ciphertext Y2's to operation key K2 encryption method particularly includes:
All odd number bit bytes of transmission key K1 are subjected to XOR operation and obtain result PIt is odd, by all even numbers of transmission key K1
Bit byte carries out XOR operation and obtains result PIt is even:
When M is even number:
PIt is odd1 ⊕ K1-byte of=K1-byte, 3 ⊕ ... ⊕ K1-byte M-1;
PIt is even0 ⊕ K1-byte of=K1-byte, 2 ⊕ ... ⊕ K1-byte M-2;
When M is odd number:
PIt is odd1 ⊕ K1-byte of=K1-byte, 3 ⊕ ... ⊕ K1-byte M-2;
PIt is even0 ⊕ K1-byte of=K1-byte, 2 ⊕ ... ⊕ K1-byte M-1;
If the first character section K1-byte0 of transmission key K1 be odd number, operate key K2 each byte respectively with PIt is oddIt carries out different
Or operation, the encrypted cipher text of the operation each byte of key K2 is obtained, then M byte cryptogram data for operating key K2 are successively deposited
The corresponding odd bits of ciphertext Y2 are stored up, the even bit of ciphertext Y2 inserts useless random data, is used for data diddling;
Ciphertext Y2 calculating process is as follows:
Y2-BYTE (2n+1)=K2-BYTE (n) ⊕ PIt is odd; 0≤n≤M-1
Y2-BYTE (2n)=any random number; 0≤n≤M-1
If the first character section K1-byte0 of transmission key K1 be even number, operate key K2 each byte respectively with PIt is evenIt carries out different
Or operation, the encrypted cipher text of the operation each byte of key K2 is obtained, then the N number of byte cryptogram data for operating key K2 are successively deposited
The corresponding even bit of ciphertext Y2 is stored up, the odd bits of ciphertext Y2 insert useless random data, are used for data diddling;
Ciphertext Y2 calculating process is as follows:
Y2-BYTE (2n)=K2-BYTE (n) ⊕ PIt is even;0≤n≤M-1
Y2-BYTE (2n+1)=any random number;0≤n≤M-1
Finally obtain ciphertext Y2.
7. a kind of encryption method based on cipher key delivery equipment as described in claim 1, it is characterised in that: the step 3
Method particularly includes:
The byte number of ciphertext Y3 is 2*M, until the M-1 byte of Y1 carries out since the B byte of ciphertext Y1
XOR operation, obtains result Temp, and the B is the remainder B in step 1;
Temp=Y1-BYTE (B) ⊕ Y1-BYTE (B+1) ⊕ ... Y1-BYTE (M-1);
The specific calculating process of encrypted cipher text Y3 is as follows:
Y3-BYTE (n)=0≤n of Temp ⊕ Y1-BYTE (n) ⊕ Y2-BYTE (n)≤M-1;
Y3-BYTE (n)=Temp ⊕ Y1-BYTE (n-M) ⊕ Y2-BYTE (n) M≤n≤2*M-1.
8. a kind of encryption method based on cipher key delivery equipment as described in claim 1, it is characterised in that: the step 4
Detailed process are as follows:
Integer A is moved to right 8, then step-by-step and upper 0X000000FF, obtains variable position data, i.e. position=(A > >
8)&0X000000FF;If position is odd number, ciphertext data assembling sequence is followed successively by integer A, ciphertext Y1, ciphertext Y3, if
Position is even number, then ciphertext data assembling sequence is followed successively by integer A, ciphertext Y3, ciphertext Y1;
All data in ciphertext after checking assembling, are transformed into 2 byte sequences for each byte 0X7E occurred in ciphertext, if
Occur the byte of 0X7D in ciphertext, be then converted into 2 byte sequences, obtains ciphertext data Y3_temp;
The length of ciphertext data Y3_temp is calculated, length length_temp is finally encapsulated as the head of 2 bytes
The tail 0X7E0X7E of 0X7E0X7E, total length of data length_all, the data ciphertext Y3_temp of 2 bytes and 2 bytes, most
The transport_Data data packet of key reception side to be transferred to is obtained afterwards, and the total length length_all includes 2 bytes
Head, the tails of 2 bytes, length length_temp and length_all itself length.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910227532.1A CN109787764B (en) | 2019-03-25 | 2019-03-25 | Encryption method of secret key |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910227532.1A CN109787764B (en) | 2019-03-25 | 2019-03-25 | Encryption method of secret key |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109787764A true CN109787764A (en) | 2019-05-21 |
CN109787764B CN109787764B (en) | 2021-07-06 |
Family
ID=66491227
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910227532.1A Active CN109787764B (en) | 2019-03-25 | 2019-03-25 | Encryption method of secret key |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109787764B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111310211A (en) * | 2020-02-19 | 2020-06-19 | 成都三零凯天通信实业有限公司 | Method for encrypting database by using SM4 algorithm |
CN112260840A (en) * | 2020-10-21 | 2021-01-22 | 上海创能国瑞数据系统有限公司 | Disturbance encryption method based on sm4 encryption algorithm |
CN113765650A (en) * | 2020-10-15 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Data encryption and decryption method and device, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04192736A (en) * | 1990-11-26 | 1992-07-10 | Matsushita Electric Ind Co Ltd | Ciphering device |
CA2229026A1 (en) * | 1995-06-01 | 1996-12-05 | Roy D. Follendore, Iii | Cryptographic access and labeling system |
CN108023724A (en) * | 2016-11-04 | 2018-05-11 | 北京展讯高科通信技术有限公司 | Data transmission method and device |
-
2019
- 2019-03-25 CN CN201910227532.1A patent/CN109787764B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04192736A (en) * | 1990-11-26 | 1992-07-10 | Matsushita Electric Ind Co Ltd | Ciphering device |
CA2229026A1 (en) * | 1995-06-01 | 1996-12-05 | Roy D. Follendore, Iii | Cryptographic access and labeling system |
CN108023724A (en) * | 2016-11-04 | 2018-05-11 | 北京展讯高科通信技术有限公司 | Data transmission method and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111310211A (en) * | 2020-02-19 | 2020-06-19 | 成都三零凯天通信实业有限公司 | Method for encrypting database by using SM4 algorithm |
CN113765650A (en) * | 2020-10-15 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Data encryption and decryption method and device, electronic equipment and storage medium |
CN112260840A (en) * | 2020-10-21 | 2021-01-22 | 上海创能国瑞数据系统有限公司 | Disturbance encryption method based on sm4 encryption algorithm |
Also Published As
Publication number | Publication date |
---|---|
CN109787764B (en) | 2021-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3186802B1 (en) | Encryption function and decryption function generating method, encryption and decryption method and related apparatuses | |
Jakimoski et al. | Chaos and cryptography: block encryption ciphers based on chaotic maps | |
CN106656475B (en) | Novel symmetric key encryption method for high-speed encryption | |
US10009170B2 (en) | Apparatus and method for providing Feistel-based variable length block cipher | |
EP1307993B1 (en) | Linear transformation for symmetric-key ciphers | |
CN109787764A (en) | A kind of encryption method based on cipher key delivery equipment | |
EP2911138A2 (en) | Variable-length block cipher apparatus and method capable of format preserving encryption | |
CN106688204A (en) | Generating cryptographic checksums | |
CN115664847B (en) | User information safe storage method of internet education platform | |
CN107241196A (en) | Digital signature method and system based on block chain technology | |
CN106452790B (en) | Multi-quantum digital signature method without trust center | |
US20110182419A1 (en) | Encryption algorithm with randomized buffer | |
Stallings | NIST block cipher modes of operation for authentication and combined confidentiality and authentication | |
CN102946315B (en) | A kind of method and system adopting packet mode to construct MAC code | |
Chu et al. | Improved Integral Attacks on SIMON32 and SIMON48 with Dynamic Key‐Guessing Techniques | |
Ooi et al. | Cryptanalysis of s-des | |
CN108768923A (en) | A kind of real-time encrypted method of chat of the Encryption Algorithm based on Quantum Reversible Logic circuit | |
Mohan et al. | An encryption technique using the adjacency matrices of certain graphs with a self-invertible key matrix | |
CN103634113B (en) | Encryption and decryption method and device with user/equipment identity authentication | |
Savitri et al. | Efficient technique image encryption with cipher block chaining and gingerbreadman map | |
CN112422278A (en) | Byte-oriented random multi-table replacement encryption and decryption method | |
Perez et al. | A Modified Key Generation Scheme of Vigenère Cipher Algorithm using Pseudo-Random Number and Alphabet Extension | |
EP0605047A1 (en) | Method for blockwise encryption/decryption using linear algebraic codes | |
Pirzada et al. | The parallel CMAC synthetic initialization vector algorithm implementation on FPGA | |
Jain et al. | Variation of playfair cipher |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |