CN111314070A - Internet communication key generation system and method thereof - Google Patents

Internet communication key generation system and method thereof Download PDF

Info

Publication number
CN111314070A
CN111314070A CN202010090232.6A CN202010090232A CN111314070A CN 111314070 A CN111314070 A CN 111314070A CN 202010090232 A CN202010090232 A CN 202010090232A CN 111314070 A CN111314070 A CN 111314070A
Authority
CN
China
Prior art keywords
key
data
unit
algorithm
mac
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.)
Pending
Application number
CN202010090232.6A
Other languages
Chinese (zh)
Inventor
殷堃
马振东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Leilong Information Technology Co Ltd
Original Assignee
Shanghai Leilong Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shanghai Leilong Information Technology Co Ltd filed Critical Shanghai Leilong Information Technology Co Ltd
Priority to CN202010090232.6A priority Critical patent/CN111314070A/en
Publication of CN111314070A publication Critical patent/CN111314070A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/085Secret sharing or secret splitting, e.g. threshold schemes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a system and a method for generating an internet communication key, wherein the method comprises the following steps: s1: obtaining 8-bit work key as source data and 8-bit master key as source data decryption key; s2: performing Des decryption on the source data by using the source data decryption key to generate an 8-bit new key; s3: and calculating the MAC value by performing a quadratic single-time long key algorithm on the plaintext data according to the 8-bit new key. The invention simplifies the complexity of MAC generation, improves the calculation efficiency in the aspect of data security verification and reduces the waiting time for algorithm realization.

Description

Internet communication key generation system and method thereof
Technical Field
The invention belongs to the technical field of internet data, and particularly relates to an internet communication key generation method. And an internet communication key generation system for implementing the method.
Background
The Hash function is also called as a Hash function, and the use of the Hash function can improve the utilization rate of a storage space, improve the query efficiency of data, and also can be used for making a digital signature to ensure the safety of data transmission. The Hash algorithm is widely used in internet applications. The MAC algorithm (Message Authentication Codes) is a Hash function with a secret key: the hash value of the message is controlled by a secret key K known only to the two communicating parties. The Hash value is now called MAC. The MAC algorithm generally implements the principle: first, a secret key is shared between two parties involved in a communication, and in the communication (where a and B are used to represent the two parties involved in the communication), the a party transmits a message to the B party, calculates a value, called an authentication flag, of the message using a Hash algorithm and the shared secret key, and then transmits the value to the B party after attaching the value to the message. B, after receiving the message, using the same mechanism to calculate the authentication mark of the received message, and comparing the authentication mark with the mark received by the user; if the two flags are the same, B considers the message as not modified in the transmission from A to B; if not, B considers the message as modified during transmission. At present, two problems exist with this implementation principle: firstly, the key is shared, if the key is leaked, an attacker can forge authentication, forge a large amount of 'legal' data and attack the data of the system. Secondly, in order to ensure the integrity of the data, a public key algorithm is combined with a Hash function to complete the data, but the public key operation speed is slow, and the processes of generating and verifying the mark are complex. Therefore, how to develop a new internet communication key generation method to overcome the above problems is a direction that needs to be studied by those skilled in the art.
Disclosure of Invention
The invention aims to provide an internet communication key generation method, which can reduce the complexity of MAC generation, improve the calculation efficiency in the aspect of data security verification and reduce the waiting time for algorithm realization.
The technical scheme is as follows:
an internet communication key generation method comprises the following steps: s1: acquiring an 8-bit work key as source data (namely WKey), and acquiring an 8-bit master key as a source data decryption key (namely Mkey); s2: performing Des decryption on the source data by using the source data decryption key to generate an 8-bit new key (namely NKey); s3: and calculating the MAC value by performing a quadratic single-time long key algorithm on the plaintext data according to the 8-bit new key.
Preferably, in the method for generating an internet communication key, the step S3 is to perform data grouping in an ECB mode, and includes: s31: carrying out data grouping on plaintext data according to 8 bytes to form a data block array (namely MAB); s32: performing exclusive-or operation on the data block array according to each 8 bytes; s33: converting the last 8 bytes obtained by the exclusive-or operation of S32 into 16 hexadecimal numbers; s34: carrying out one-time single-time long key algorithm operation encryption on the first 8 bytes of the hexadecimal number obtained in the S33 by using the 8-bit new key; s35: performing exclusive-or operation on the byte obtained after encryption in the step S34 and the last 8 bytes of the hexadecimal number obtained in the step S33; s36: performing secondary single-time key algorithm operation encryption on the operation result obtained in the step S35 based on TEMP BLOCK; s37: and converting the operation result obtained in the step S36 into 16 hexadecimal numbers, wherein the 16 hexadecimal numbers are the data MAC.
Adopt above-mentioned technical scheme: by customizing double-key Des decryption dispersion and single-time long key algorithm operation, the problem of key leakage caused by sharing a key in the MAC calculation implementation process is solved; meanwhile, the MAC generation complexity is greatly simplified, the calculation efficiency of the system in the aspect of data security verification is improved, and the algorithm implementation waiting time of the system in a high concurrency scene is reduced.
In order to realize the method for generating the internet communication key, the invention also discloses a system for generating the internet communication key, which adopts the following technical scheme:
an internet communication key generation system, comprising: the system comprises a basic data processing module, an MAC calculation module and a receiving processor; the basic data processing module comprises a key unit, an encryption key unit, a data grouping unit and a tool unit; the MAC calculation module comprises a Des algorithm unit, an MAC calculation unit and a Java language standard algorithm package; the key unit is used for generating and storing a key or a key pair according to a pre-storage algorithm; the encryption key unit is used for realizing the dispersion and recombination of keys according to a pre-stored algorithm; the data grouping unit is used for realizing data grouping and data completion of data to be encrypted; the tool unit is used for providing a universal function for realizing type data operation, data calculation, data forward/backward interchange, system conversion and memory address operation; the Des algorithm unit is used for packaging an improved Des standard algorithm and providing an encryption algorithm for the MAC calculation unit; the MAC calculation unit is used for providing an internal callable function interface and realizing MAC calculation for the receiving processor; the Java language standard algorithm package is used for providing a Java implementation class library of a Des algorithm for a Des algorithm unit; the receiving processor is used for accessing the basic data processing module and the MAC calculation module and calling the key unit, the encryption key unit, the data grouping unit and the MAC calculation unit to finish data MAC calculation.
By adopting the technical scheme:
the receiving processor supports data receiving in two modes of local calling and network interface calling, is used for receiving data plaintext, carries out scheduling of each module of MAC calculation and returns an MAC calculated value. The specific working process is as follows: after receiving the data to be processed, the receiving processor firstly calls a key unit in the basic data processing module to perform algorithm processing of a main key and a working key and support the processing of two key types of a text key character string and a key file. And obtaining a new working key NKey by calling a double-key DES decryption dispersion algorithm in the encryption key unit. And then grouping the data according to bytes by calling a data grouping unit, completing, obtaining N data blocks and storing the N data blocks in the memory in an array mode. And then the receiving processor calculates basic data based on the obtained MAC, carries out multiple XOR on the data block array by calling the MAC calculation unit and a Des algorithm stored in the Des algorithm unit, and calculates a final MAC value by carrying out arithmetic operation on an XOR result by a single-time long key algorithm. And returning the MAC value to the calling party to finish the whole process of data MAC calculation.
Compared with the prior art, the method simplifies the complexity of MAC generation, improves the computational efficiency in the aspect of data security verification, and reduces the waiting time for algorithm implementation.
Drawings
The invention is described in further detail in the following description of embodiments with reference to the accompanying drawings:
FIG. 1 is a schematic flow diagram of the present invention;
FIG. 2 is a schematic diagram of a process for performing data grouping and XOR operations on plaintext data;
FIG. 3 is a schematic diagram of a process for calculating a MAC value for the data result of the operation of FIG. 2;
fig. 4 is a schematic structural diagram of the present invention.
The corresponding relation between each reference mark and the part name is as follows:
1. a basic data processing module; 2. a MAC calculation module; 3. a receive processor; 11. a key unit; 12. an encryption key unit; 13. a data grouping unit; 14. a tool unit; 21. a Des algorithm unit; 22. a MAC calculation unit; 23. java language standard algorithm package.
Detailed Description
In order to more clearly illustrate the technical solution of the present invention, the above description will be further described with reference to various embodiments.
Example 1:
fig. 4 shows an internet communication key generation system for implementing the present invention:
it includes: a basic data processing module 1, an MAC calculation module 2 and a receiving processor 3; the basic data processing module 1 comprises a key unit 11, an encryption key unit 12, a data grouping unit 13 and a tool unit 14; the MAC calculation module 2 comprises a Des algorithm unit 21, an MAC calculation unit 22 and a Java language standard algorithm package 23; the key unit 11 is configured to generate and store a key or a key pair according to a pre-storage algorithm; the encryption key unit 12 is used for realizing the dispersion and recombination of keys according to a pre-stored algorithm; the data grouping unit 13 is used for realizing data grouping and data completion of data to be encrypted; the tool unit 14 is used for providing general functions for implementing type data operation, data calculation, data forward/backward interchange, binary conversion and memory address operation; the Des algorithm unit 21 is configured to encapsulate an improved Des standard algorithm and provide an encryption algorithm for the MAC calculation unit; the MAC calculation unit 22 is configured to provide an internal callable function interface, and implement MAC calculation for the receiving processor 3; the Java language standard algorithm package 23 is used for providing a Java implementation class library of the Des algorithm for the Des algorithm unit 21; the receiving processor 3 is used for accessing the basic data processing module 1 and the MAC calculating module 2, and calling the key unit 11, the encryption key unit 12, the data grouping unit 13 and the MAC calculating unit 22 to complete data MAC calculation.
As shown in fig. 1-3: the process for realizing the generation of the internet communication key based on the system is as follows:
s1: obtaining 8-bit work key as source data and 8-bit master key as source data decryption key;
s2: performing Des decryption on the source data by using the source data decryption key to generate an 8-bit new key;
s3: and calculating the MAC value by performing a quadratic single-time long key algorithm on the plaintext data according to the 8-bit new key.
Wherein the step S3 specifically includes the following steps:
s31: the plaintext data is grouped by 8 bytes to form MAB (MAC ELEMEMENT BLOCK)
S311: grouping data to be calculated according to 8 bytes;
s312: if the last group is less than 8 bytes, padding "0X 00" to complete and finally acquire the MAB:
let MAB be M1M 2M 3M 4
Wherein:
M1=MS11 MS12 MS13 MS14 MS15 MS16 MS17 MS18
M2=MS21 MS22 MS23 MS24 MS25 MS26 MS27 MS28
M3=MS31 MS32 MS33 MS34 MS35 MS36 MS37 MS38
M4=MS41 MS42 MS43 MS44 MS45 MS46 MS47 MS48
……
MN=MSN1 MSN2 MN33 0x00 0x00 0x00 0x00 0x00
s32: performing exclusive-or operation on the MAB according to every 8 bytes, wherein the specific process is as follows:
MS11 MS12 MS13 MS14 MS15 MS16 MS17 MS18
XOR) MS21 MS22 MS23 MS24 MS25 MS26 MS27 MS28
---------------------------------------------------
TEMP BLOCK1=TM11 TM12 TM13 TM14 TM15 TM16 TM17 TM18
then, the next operation is carried out:
TM11 TM12 TM13 TM14 TM15 TM16 TM17 TM18
XOR) MS31 MS32 MS33 MS34 MS35 MS36 MS37 MS38
---------------------------------------------------
TEMP BLOCK2=TM21 TM22 TM23 TM24 TM25 TM26 TM27 TM28
and then the next operation is carried out:
TM21 TM22 TM23 TM24 TM25 TM26 TM27 TM28
XOR) MS41 MS42 MS43 MS44 MS45 MS46 MS47 MS48
---------------------------------------------------
RESULT BLOCK=TM31 TM32 TM33 TM34 TM35 TM36 TM37 TM38
s33: the last 8 bytes from the exclusive or operation of S32 are converted into 16 hexadecimal numbers:
RESULT BLOCK=TM31 TM32 TM33 TM34 TM35 TM36 TM37 TM38
=TM311 TM312 TM321 TM322 TM331 TM332 TM341 TM342||
TM351 TM352 TM361 TM362 TM371 TM372 TM381 TM382
s34: and (3) carrying out one-time single-time long key algorithm operation encryption on the first 8 bytes of the hexadecimal number obtained in the S33 by using the 8-bit new key:
ENC BLOCK1=eMAK(TM311 TM312 TM321 TM322 TM331 TM332 TM341 TM342)
=EN11 EN12 EN13 EN14 EN15 EN16 EN17 EN18
s35: exclusive-oring the byte obtained after encrypting at S34 with the last 8 bytes of the hexadecimal number obtained at S33:
EN11 EN12 EN13 EN14 EN15 EN16 EN17 EN18
XOR) TM351 TM352 TM361 TM362 TM371 TM372 TM381 TM382
------------------------------------------------------------
TEMP BLOCK=TE11 TE12 TE13 TE14 TE15 TE16 TE17 TE18
s36: performing secondary single-time key algorithm operation encryption on the operation result obtained in the step S35 based on TEMP BLOCK;
ENC BLOCK2=eMAK(TE11 TE12 TE13 TE14 TE15 TE16 TE17 TE18)
=EN21 EN22 EN23 EN24 EN25 EN26 EN27 EN28
s37: the operation result obtained in S36 is converted into 16 hexadecimal numbers:
ENC BLOCK2=EN21 EN22 EN23 EN24 EN25 EN26 EN27 EN28
=EM211 EM212 EM221 EM222 EM231 EM232 EM241 EM242||
EM251 EM252 EM261 EM262 EM271 EM272 EM281 EM282
the 16 hexadecimal numbers are the data MAC.
The above description is only an embodiment of the present invention, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the protection scope of the present invention. The protection scope of the present invention is subject to the protection scope of the claims. Furthermore, although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.

Claims (3)

1. An internet communication key generation method, comprising the steps of:
s1: obtaining 8-bit work key as source data and 8-bit master key as source data decryption key;
s2: performing Des decryption on the source data by using the source data decryption key to generate an 8-bit new key;
s3: and calculating the MAC value by performing a quadratic single-time long key algorithm on the plaintext data according to the 8-bit new key.
2. The internet communication key generation method of claim 1, wherein the step S3 includes:
s31: carrying out data grouping on plaintext data according to 8 bytes to form a data block array;
s32: performing exclusive-or operation on the data block array according to each 8 bytes;
s33: converting the last 8 bytes obtained by the exclusive-or operation of S32 into 16 hexadecimal numbers;
s34: carrying out one-time single-time long key algorithm operation encryption on the first 8 bytes of the hexadecimal number obtained in the S33 by using the 8-bit new key;
s35: performing exclusive-or operation on the byte obtained after encryption in the step S34 and the last 8 bytes of the hexadecimal number obtained in the step S33;
s36: performing secondary single-time key algorithm operation encryption on the operation result obtained in the step S35 based on TEMP BLOCK;
s37: and converting the operation result obtained in the step S36 into 16 hexadecimal numbers, wherein the 16 hexadecimal numbers are the data MAC.
3. An internet communication key generation system, comprising: a basic data processing module (1), a MAC calculation module (2) and a receiving processor (3);
the basic data processing module (1) comprises a key unit (11), an encryption key unit (12), a data grouping unit (13) and a tool unit (14); the MAC calculation module (2) comprises a Des algorithm unit (21), a MAC calculation unit (22) and a Java language standard algorithm package (23); the key unit (11) is used for generating and storing a key or a key pair according to a pre-storing algorithm; the encryption key unit (12) is used for realizing the dispersion and recombination of keys according to a pre-stored algorithm; the data grouping unit (13) is used for realizing data grouping and data completion of data to be encrypted; the tool unit (14) is used for providing general functions for realizing type data operation, data calculation, data forward/backward interchange, binary conversion and memory address operation; the Des algorithm unit (21) is used for packaging an improved Des standard algorithm and providing an encryption algorithm for the MAC calculation unit; the MAC calculation unit (22) is used for providing an internal callable function interface and realizing MAC calculation for the receiving processor (3); the Java language standard algorithm package (23) is used for providing a Java implementation class library of a Des algorithm for the Des algorithm unit (21); the receiving processor (3) is used for accessing the basic data processing module (1) and the MAC calculation module (2) and calling the key unit (11), the encryption key unit (12), the data grouping unit (13) and the MAC calculation unit (22) to complete data MAC calculation.
CN202010090232.6A 2020-02-13 2020-02-13 Internet communication key generation system and method thereof Pending CN111314070A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010090232.6A CN111314070A (en) 2020-02-13 2020-02-13 Internet communication key generation system and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010090232.6A CN111314070A (en) 2020-02-13 2020-02-13 Internet communication key generation system and method thereof

Publications (1)

Publication Number Publication Date
CN111314070A true CN111314070A (en) 2020-06-19

Family

ID=71148971

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010090232.6A Pending CN111314070A (en) 2020-02-13 2020-02-13 Internet communication key generation system and method thereof

Country Status (1)

Country Link
CN (1) CN111314070A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102332981A (en) * 2011-10-12 2012-01-25 深圳市沃达通实业有限公司 Three-layer key encryption method and bank transaction system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102332981A (en) * 2011-10-12 2012-01-25 深圳市沃达通实业有限公司 Three-layer key encryption method and bank transaction system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
GAKKI的二向箔: "《银联规范的密钥体系》", 《HTTPS://BLOG.CSDN.NET/CARL_WU_/ARTICLE/DETAILS/77747544》 *

Similar Documents

Publication Publication Date Title
CN100574188C (en) secure communication
CN110795762B (en) Reserved format encryption method based on stream cipher
NZ277128A (en) Public key encryption system and mixture generator
CN102904711B (en) Information ciphering method
CN101401141A (en) Information processing system, information processing method, and information processing program
CN101202623A (en) Method of generating message authentication code using stream cipher and authentication/encryption and authentication/decryption methods using stream cipher
WO2014136386A1 (en) Tag generation device, tag generation method, and tag generation program
CN111010266B (en) Message encryption and decryption, reading and writing method and device, computer equipment and storage medium
CN112165443A (en) Multi-key information encryption and decryption method and device and storage medium
CN116321129B (en) Lightweight dynamic key-based power transaction private network communication encryption method
CN113726725A (en) Data encryption and decryption method and device, electronic equipment and storage medium
CN114826587B (en) Data encryption method, data decryption method, data encryption device, data decryption device and data decryption equipment
CN114172651B (en) SM9 public key encryption algorithm and decryption algorithm GPU acceleration implementation method
WO2021129470A1 (en) Polynomial-based system and method for fully homomorphic encryption of binary data
CN101582170B (en) Remote sensing image encryption method based on elliptic curve cryptosystem
CN108599922B (en) Novel method for generating integrity authentication code of message containing secret key
CN111314070A (en) Internet communication key generation system and method thereof
CN112907247B (en) Block chain authorization calculation control method
CN115378614A (en) Data transmission method and device and electronic equipment
CN114139177A (en) Token generation method, system and device
JP5586758B1 (en) Dynamic encryption key generation system
CN103888937B (en) A kind of low overhead suitable for wireless sensor network AES encryption quickly takes turns encryption device and method
CN114430549A (en) White box encryption and decryption method and device suitable for wireless communication
CN111131158A (en) Single byte symmetric encryption and decryption method, device and readable medium
KR20020051597A (en) Data encryption system and its method using asymmetric key encryption algorithm

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200619