WO2019223170A1 - 加密方法、装置、计算机设备和存储介质 - Google Patents

加密方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2019223170A1
WO2019223170A1 PCT/CN2018/104293 CN2018104293W WO2019223170A1 WO 2019223170 A1 WO2019223170 A1 WO 2019223170A1 CN 2018104293 W CN2018104293 W CN 2018104293W WO 2019223170 A1 WO2019223170 A1 WO 2019223170A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
algorithm
encryption
data
decryption
Prior art date
Application number
PCT/CN2018/104293
Other languages
English (en)
French (fr)
Inventor
刘丹
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019223170A1 publication Critical patent/WO2019223170A1/zh

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/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • 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/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
    • H04L63/0435Network 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 wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • 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

Definitions

  • the present application relates to the fields of information security and the like, and in particular, to an encryption method, device, computer device, and storage medium.
  • CRM customer relationship management system
  • An encryption method including:
  • the sending end uses the encryption algorithm and the encryption key to encrypt the data to be sent to obtain encrypted data.
  • the communication cipher text is generated according to the calculation factor of the encryption algorithm and the encrypted data, and the communication cipher text is sent to the receiving end through the network;
  • the receiving end receives the communication ciphertext to obtain the calculation factor of the corresponding decryption algorithm and the data to be decrypted.
  • the calculation factor of the decryption algorithm is used to determine the minimum number of bytes required for the decryption algorithm and the key of the corresponding algorithm, and then according to the decryption algorithm's The calculation factor and the minimum number of bytes are calculated to obtain a decryption key.
  • the decryption key and the decryption algorithm are used to decrypt the decrypted data to obtain the decrypted data.
  • the communication plaintext is generated according to the calculation factor of the decryption algorithm and the decrypted data.
  • An encryption device includes:
  • Sending setting unit which is set to set the encryption algorithm and the minimum number of bytes required for the encryption algorithm key on the sending end;
  • the encryption unit is set up so that the sender uses the encryption algorithm and the encryption key to encrypt the data to be sent to obtain encrypted data, generates a communication ciphertext based on the calculation factor of the encryption algorithm and the encrypted data, and sends the communication ciphertext to the receiver through the network;
  • a receiving setting unit which is set to a minimum number of bytes required to set a decryption algorithm and a key of the decryption algorithm correspondingly at the receiving end;
  • the decryption unit is set to receive the communication ciphertext to obtain the calculation factor of the corresponding decryption algorithm and the data to be decrypted.
  • the calculation factor of the decryption algorithm is used to determine the minimum number of bytes required for the decryption algorithm and the key of the corresponding algorithm, and then Then, the decryption key is calculated according to the calculation factor and the minimum number of bytes of the decryption algorithm.
  • the decryption key and the decryption algorithm are used to decrypt the decrypted data to obtain the decrypted data.
  • the communication plaintext is generated based on the decryption algorithm's calculation factor and the decrypted data.
  • a computer device includes a memory and a processor.
  • the memory stores computer-readable instructions.
  • the processor causes the processor to perform the following steps:
  • the sender uses the encryption algorithm and the encryption key to encrypt the data to be sent to obtain encrypted data.
  • the communication ciphertext is generated according to the calculation factor of the encryption algorithm and the encrypted data, and the communication ciphertext is sent to the receiver through the network;
  • the receiving end receives the communication ciphertext to obtain the calculation factor of the corresponding decryption algorithm and the data to be decrypted.
  • the calculation factor of the decryption algorithm is used to determine the minimum number of bytes required for the decryption algorithm and the key of the corresponding algorithm, and then according to the decryption algorithm's The calculation factor and the minimum number of bytes are calculated to obtain a decryption key.
  • the decryption key and the decryption algorithm are used to decrypt the decrypted data to obtain the decrypted data.
  • the communication plaintext is generated according to the calculation factor of the decryption algorithm and the decrypted data.
  • a storage medium storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the following steps:
  • the sending end uses the encryption algorithm and the encryption key to encrypt the data to be sent to obtain encrypted data.
  • the communication cipher text is generated according to the calculation factor of the encryption algorithm and the encrypted data, and the communication cipher text is sent to the receiving end through the network;
  • the receiving end receives the communication ciphertext to obtain the calculation factor of the corresponding decryption algorithm and the data to be decrypted.
  • the calculation factor of the decryption algorithm is used to determine the minimum number of bytes required for the decryption algorithm and the key of the corresponding algorithm, and then according to the decryption algorithm's The calculation factor and the minimum number of bytes are calculated to obtain a decryption key.
  • the decryption key and the decryption algorithm are used to decrypt the decrypted data to obtain the decrypted data.
  • the communication plaintext is generated according to the calculation factor of the decryption algorithm and the decrypted data.
  • the encryption algorithm and the encryption algorithm key required by the sender are set at the sender.
  • the sender uses the encryption algorithm and the encryption key to encrypt the data to be transmitted to obtain encrypted data.
  • the communication ciphertext is generated according to the calculation factor of the encryption algorithm and the encrypted data, and the communication ciphertext is sent to the receiving end through the network. Set the minimum number of bytes required for the decryption algorithm and the key of the decryption algorithm at the receiving end.
  • the receiving end receives the communication ciphertext to obtain the calculation factor of the corresponding decryption algorithm and the data to be decrypted.
  • the calculation factor of the decryption algorithm is used to determine the minimum number of bytes required for the decryption algorithm and the key of the corresponding algorithm, and then according to the decryption algorithm's The calculation factor and the minimum number of bytes are calculated to obtain the decryption key.
  • the decryption key and the decryption algorithm are used to decrypt the decrypted data to obtain the decrypted data.
  • the clear text of the communication is generated based on the calculation factor of the decryption algorithm and the decrypted data, which improves security and guarantees that Data integrity, efficient and fast encryption and decryption.
  • FIG. 1 is a flowchart of an encryption method provided in an embodiment of the present application
  • FIG. 2A is a schematic diagram of a coding matrix according to an embodiment of the present application.
  • 2B is a schematic diagram of key generation in an embodiment of the present application.
  • 2C is a schematic diagram of key generation in an embodiment of the present application.
  • 2D is a schematic diagram of key generation in an embodiment of the present application.
  • 2E is a schematic diagram of key generation in an embodiment of the present application.
  • FIG. 3 is a structural block diagram of an encryption device in an embodiment.
  • an encryption method includes the following steps:
  • Step S101 Set the encryption algorithm and the minimum number of bytes required by the encryption algorithm key at the sending end;
  • Select the encryption / integrity algorithm When defining the encryption object of the stored data, give information such as the encryption algorithm, working mode, and whether to perform integrity check.
  • the key is stored in the user metadata in advance by the user or changed dynamically during the session. Because the encryption algorithm is set in advance in this application, the data type of the encryption target can be unlimited. Assuming that the current technology allows the length of the cryptographic key to be between 1 and 160 bytes (8 and 1280 bytes), the CRM system has set certain restrictions on the minimum and maximum lengths of the cryptographic key.
  • Step S102 The transmitting end uses the encryption algorithm and the encryption key to encrypt the transmitted data to obtain encrypted data, generates a communication ciphertext according to the calculation factor of the encryption algorithm and the encrypted data, and sends the communication ciphertext to the receiving end through the network;
  • the sender uses the encryption algorithm and the encryption key to encrypt the data to be sent to obtain encrypted data, generates the communication ciphertext according to the calculation factor of the encryption algorithm and the encrypted data, and sends the communication ciphertext to the receiver through the network.
  • Step S103 Set the decryption algorithm and the minimum number of bytes required for the decryption algorithm key correspondingly at the receiving end;
  • the receiving end receives the communication ciphertext to obtain the corresponding decryption algorithm factor and the data to be decrypted.
  • the decryption algorithm factor is used to determine the minimum number of bytes required for the decryption algorithm and the key of the corresponding algorithm, and then according to the decryption algorithm factor Calculate with the minimum number of bytes to obtain the decryption key, use the decryption key and the decryption algorithm to decrypt the data to be decrypted to obtain the decryption data, and generate the communication clear text according to the decryption algorithm factor and the decryption data.
  • Received byte count calculation which calculates the number of bytes of the data segment reaching the receiving side within a certain period at the transmitting end, and the transmitting data end control unit, which is based on the word of the data segment calculated by the received byte number calculating unit. Number of sections to control the number of transmitted data segments.
  • a corresponding symmetric encryption algorithm is set in advance on the sending end and the receiving end respectively, and the encryption algorithm and the used key are selected according to the content of the data to be sent. No additional key information needs to be transmitted, which is efficient, fast, and highly secure. .
  • Step S104 The receiving end receives the communication ciphertext to obtain the calculation factor of the corresponding decryption algorithm and the data to be decrypted.
  • the calculation factor of the decryption algorithm is used to determine the minimum number of bytes required for the decryption algorithm and the key of the corresponding algorithm.
  • the decryption algorithm calculates the calculation factor and the minimum number of bytes to obtain the decryption key.
  • the decryption key and decryption algorithm are used to decrypt the decrypted data to obtain the decrypted data.
  • the communication plaintext is generated based on the decryption algorithm's calculation factor and the decrypted data.
  • the encrypted symmetric key is first decrypted with the known symmetric key, and then the ciphertext is decrypted with the decrypted symmetric key to obtain the original text. In this way, each time a data packet is transmitted, the symmetric key encryption / decryption is performed. once.
  • the method before the data to be sent is encrypted, the method further includes: determining field data and field names of each predetermined field in the data to be sent, using the field name as a key, and the corresponding field data as a value, and performing grouping to obtain a data packet.
  • the plaintext sequence will be in the form of a data packet, and each group will be encrypted with the same encryption algorithm and different keys; the length of the encrypted data packet is the same as the length of the plaintext data packet, which will not increase redundant information and is suitable for large batches.
  • the encryption of the data guarantees the integrity of the data.
  • the encryption algorithm is a symmetric encryption algorithm
  • the decryption algorithm is the same symmetric decryption algorithm as the encryption algorithm.
  • Symmetric algorithm Encryption and decryption use the same algorithm except that the key arrangement is different.
  • the similarity between encryption and decryption, that is, the difference between the encryption and decryption processes is only in the way the keys are used, and the same algorithm is used to implement encryption and decryption, which is faster.
  • the predetermined field further includes a synchronization word, a length word, and check information, where the synchronization word is used to query the start position of the data packet, the length word is used to determine the length of the data packet, and the check information is used to check the data packet. Data validity.
  • the synchronization word is used to query the starting position of the data packet
  • the length word is used to determine the length of the data packet
  • the check information is used to check the validity of the data of the data packet, and other information can be added according to the actual situation.
  • the data packet information is used to control the validity and validity of the data in the data packet, read the cached data and look up the synchronization word, and search the read data in a loop until the synchronization word is met, and record the current data position information.
  • Find the length word after querying the synchronization word, find the length word, record the current data position information and packet length information, obtain the corresponding check information based on the query length information, check the data packet and compare and record the check information, equal The check is correct and constitutes a complete valid data packet, otherwise the data packet is invalid.
  • ciphertext IP -1 (f k2 (SW (f k1 (IP (plaintext)))))
  • K 1 P8 (shift (P10 (key k))
  • K 2 P8 (shift (shift (P10 (key k)))
  • IP is the initial replacement and IP -1 is the reverse replacement of the initial replacement IP.
  • SW is a swap function that swaps the 4 bits on the left and right
  • the compound round function f k1 and the compound round function f k2 are determined by the keys K 1 and K 2 respectively, and are responsible for permutation and substitution operations.
  • L and R are 8-bit inputs
  • left and right are 4 bits
  • F is a mapping from 4-bit set to 4-bit set
  • SK is a sub-key
  • key K and plain text are two pre-entered parameters.
  • Key K is the data input in the algorithm for converting plain text to cipher text or converting cipher text to plain text. The results of encrypting plain text with different keys K are different, but the same algorithm is used;
  • P8 is a preset 8-bit key
  • P10 is a preset 10-bit key
  • the initial replacement IP and the reverse initial replacement IP -1 replace the 64-bit plaintext position to obtain an out-of-order 64-bit plaintext group, which is then divided into two left and right segments, each of which is 32 bits, represented by L 0 and R 0 .
  • the difference in the number of column element position numbers is 8, which is equivalent to writing the bytes of the original plain text in columns.
  • the rows are reversed.
  • the elements in the array are read out in rows to form the replacement output.
  • Inverse initial permutation IP -1 The 64-bit group given after 16 rounds of iteration is replaced to obtain the output ciphertext group.
  • the output is the result of reading the elements in the array row by row.
  • IP and IP -1 The role of IP and IP -1 is to disrupt the relationship of the original ASCII codeword division of input x, and to change the check digits x8, x16, x32, and x64 of the original plain text into one byte of IP output.
  • the swap function SW swaps the left and right 4 bits so that the second f k processes the other 4 bits.
  • the compound round function f k1 and the compound round function f k2 are determined by the keys K 1 and K 2 respectively, and are responsible for the permutation and substitution operations. Among them, L and R are 8-bit inputs, left and right are 4 bits, and F is a mapping from a 4-bit set to a 4-bit set.
  • SK is a subkey
  • K is The parameters entered in advance during symmetric encryption.
  • the ciphertext is the ciphertext generated during symmetric encryption.
  • the symmetric decryption algorithm is the inverse operation of the symmetric encryption algorithm.
  • a 10-bit key be (k 1 , k 2 , k 3 , k 4 , k 5 , k 6 , k 7 , k 8 , k 9 , k 10 ),
  • P10 1, 2, 3, 4, 6, 8, 9 and 10
  • LS-1 is rotated by 1 bit to the left;
  • LS-2 is a cyclic left shift to the left by 2 bits
  • ciphertext IP-1 ⁇ fk2 ⁇ SW ⁇ fk1 ⁇ IP;
  • ciphertext IP -1 (f k2 (SW (f k1 (IP (plaintext)))))
  • K 1 P8 (shift (P10 (key k))
  • K 2 P8 (shift (shift (P10 (key k)))).
  • IP is the initial replacement and IP -1 is the reverse replacement of the initial replacement IP.
  • SW is a swap function that swaps the 4 bits on the left and right
  • the compound round function f k1 and the compound round function f k2 are determined by the keys K 1 and K 2 respectively, and are responsible for permutation and substitution operations.
  • L and R are 8-bit inputs
  • left and right are 4 bits
  • F is a mapping from a 4-bit set to a 4-bit set
  • SK is a sub-key
  • the key K is a parameter previously input during symmetric encryption.
  • the text is a ciphertext generated during symmetric encryption
  • the symmetric decryption algorithm is the inverse operation of the symmetric encryption algorithm.
  • the permutation of the end algorithm is the reverse permutation of IP:
  • IP -1 1 2 3 4 5 6 7 8
  • an encryption device is provided, and the encryption device includes:
  • Sending setting unit which is set to set the encryption algorithm and the minimum number of bytes required for the encryption algorithm key on the sending end;
  • the encryption unit is set up so that the sender uses the encryption algorithm and the encryption key to encrypt the data to be sent to obtain encrypted data, generates a communication ciphertext based on the calculation factor of the encryption algorithm and the encrypted data, and sends the communication ciphertext to the receiver through the network;
  • a receiving setting unit which is set to a minimum number of bytes required to set a decryption algorithm and a key of the decryption algorithm correspondingly at the receiving end;
  • the decryption unit is set to receive the communication ciphertext to obtain the calculation factor of the corresponding decryption algorithm and the data to be decrypted.
  • the calculation factor of the decryption algorithm is used to determine the minimum number of bytes required for the decryption algorithm and the key of the corresponding algorithm, and then Then, the decryption key is calculated according to the calculation factor and the minimum number of bytes of the decryption algorithm.
  • the decryption key and the decryption algorithm are used to decrypt the decrypted data to obtain the decrypted data.
  • the communication plaintext is generated based on the decryption algorithm's calculation factor and the decrypted data.
  • the encryption unit is further configured to determine the field data and field name of each predetermined field in the data to be sent, and use the field name as a key and the corresponding field data as a value to perform packetizing to obtain a data packet.
  • the encryption algorithm is a symmetric encryption algorithm
  • the decryption algorithm is the same symmetric decryption algorithm as the encryption algorithm.
  • the predetermined field further includes a synchronization word, a length word, and check information, where the synchronization word is used to query a start position of a data packet, the length word is used to determine a data packet length, and the check information is used to check Packet data validity.
  • ciphertext IP -1 (f k2 (SW (f k1 (IP (plaintext)))))
  • K 1 P8 (shift (P10 (key k))
  • K 2 P8 (shift (shift (P10 (key k)))
  • IP is the initial replacement and IP -1 is the reverse replacement of the initial replacement IP.
  • SW is a swap function that swaps the 4 bits on the left and right
  • the compound round function f k1 and the compound round function f k2 are determined by the keys K 1 and K 2 respectively, and are responsible for permutation and substitution operations.
  • L and R are 8-bit inputs
  • left and right are 4 bits
  • F is a mapping from 4-bit set to 4-bit set
  • SK is a sub-key
  • key K and plain text are two pre-entered parameters.
  • Key K is the data input in the algorithm for converting plain text to cipher text or converting cipher text to plain text. The results of encrypting plain text with different keys K are different, but the same algorithm is used;
  • P8 is a preset 8-bit key
  • P10 is a preset 10-bit key
  • IP is the initial replacement and IP -1 is the reverse replacement of the initial replacement IP.
  • SW is a swap function that swaps the 4 bits on the left and right
  • K 1 P8 (shift (P10 (key k))
  • K 2 P8 (shift (shift (P10 (key k)))
  • the compound round function f k1 and the compound round function f k2 are determined by the keys K 1 and K 2 respectively, and are responsible for permutation and substitution operations.
  • L and R are 8-bit inputs
  • left and right are 4 bits
  • F is a mapping from a 4-bit set to a 4-bit set
  • SK is a sub-key
  • the key K is a parameter previously input during symmetric encryption.
  • the text is a ciphertext generated during symmetric encryption
  • the symmetric decryption algorithm is the inverse operation of the symmetric encryption algorithm.
  • a computer device in one embodiment, includes a memory and a processor.
  • the memory stores computer-readable instructions.
  • the processor causes the processor to execute the computer program. The steps in the encryption method in the above embodiments are implemented at all times.
  • a storage medium storing computer-readable instructions.
  • the computer-readable instructions are executed by one or more processors, the one or more processors are caused to execute the encryption methods in the foregoing embodiments.
  • the storage medium may be a non-volatile storage medium.
  • the program may be stored in a computer-readable storage medium.
  • the storage medium may include: Read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks, etc.

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)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请涉及一种加密方法、装置、计算机设备和存储介质,所述方法包括:在发送端设置加密算法以及加密算法的密钥所需的最小字节数;发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端;在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,根据解密算法的计算因数和解密数据生成通信明文。上述方法,弥补了现有技术在安全性上的不足,并保证了数据的完整性。

Description

加密方法、装置、计算机设备和存储介质
本申请要求于2018年05月21日提交中国专利局、申请号为201810485850.3、发明名称为“加密方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息安全等领域,尤其涉及一种加密方法、装置、计算机设备和存储介质。
背景技术
客户关系管理系统(CRM)提供了创建和维护客户清晰概况所需的工具和能力,包括从第一次接触到购买和售后。对于复杂的组织,CRM系统可以提供帮助改善销售、市场营销、和/或客户服务组织发现新的客户目标、管理市场营销活动、以及驱动销售活动的特征和能力。
由于信息时代数据量的暴增,信息和数据的隐私安全成为各商业领域内最有价值的资产,各商业公司会对自己领域内的数据从系统准入到数据读取都会做严格的信息保护,数据加密就是对信息进行保护的一种有效手段,能够阻止非授权用户的读取和传播。
现有技术在处理客户信息传递时,由于未加密,容易绕开监管非法读取客户信息,并自行联系客户,许以不能达到的承诺,进而批量收集客户传递的信息在非法买卖,造成公司被投诉,客户流失。
发明内容
有鉴于此,有必要针对处理客户信息传递时,因未加密导致数据的保护安全性不够高的问题,提供一种加密方法、装置、计算机设备和存储介质。
一种加密方法,包括:
在发送端设置加密算法以及加密算法的密钥所需的最小字节数;
发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端;
在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;
接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密钥,使用解密密钥和解密算法对待解密数据进行解密得到解密数据,根据解密算法的计算因数和解密数据生成通信明文。
一种加密装置,包括:
发送设置单元,设置为在发送端设置加密算法以及加密算法的密钥所需的最小字节数;
加密单元,设置为发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端;
接收设置单元,设置为在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;
解密单元,设置为接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密钥,使用解密密钥和解密算法对待解密数据进行解密得到解密数据,根据解密算法的计算因数和解密数据生成通信明文。
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
在发送端设置加密算法以及加密算法的密钥所需的最小字节数;
发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至 接收端;
在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;
接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密钥,使用解密密钥和解密算法对待解密数据进行解密得到解密数据,根据解密算法的计算因数和解密数据生成通信明文。
一种存储有计算机可读指令的存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
在发送端设置加密算法以及加密算法的密钥所需的最小字节数;
发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端;
在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;
接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密钥,使用解密密钥和解密算法对待解密数据进行解密得到解密数据,根据解密算法的计算因数和解密数据生成通信明文。
上述加密方法、装置、计算机设备和存储介质,通过在发送端设置加密算法以及加密算法的密钥所需的最小字节数,发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,确定待发送数据中各个预定字段的字段数据以及字段名称,将所述字段名称作为键,对应的字段数据作为值,进行组包获得数据包。根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端。在接收端对应设置解密算法和解密算法的密钥所需的最小字节数。接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密钥,使 用解密密钥和解密算法对待解密数据进行解密得到解密数据,根据解密算法的计算因数和解密数据生成通信明文,提高了安全性,保证了数据的完整性,加解密的高效快捷。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。
图1为本申请一个实施例中提供的加密方法的流程图;
图2A为本申请一个实施例中编码矩阵示意图;
图2B为本申请一个实施例中密钥生成示意图;
图2C为本申请一个实施例中密钥生成示意图;
图2D为本申请一个实施例中密钥生成示意图;
图2E为本申请一个实施例中密钥生成示意图;
图3为一个实施例中加密装置的结构框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本申请的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。
作为一个较好的实施例,如图1所示,一种加密方法,该加密方法包括以下步骤:
步骤S101,在发送端设置加密算法以及加密算法的密钥所需的最小字节数;
选择加密/完整性算法,在定义存储数据的加密对象时,给出加密算法、工作模式、是否进行完整性检查等信息。而密钥由用户事先保存在用户元数据中或在会话过程中动态进行改变。本申请由于事先设定加密算法,使得可以不限制加密对象的数据类型。假定当前技术允许密码密钥长度是在1和160字节(8和1280字节)的长度,CRM系统已经对该密码密钥的最小长度和最大长度设置了某些限制。
步骤S102,发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端;
发送端使用该加密算法和该加密密钥对即将待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成该通信密文,将该通信密文通过网络发送至接收端。计算因数,数学名词,例如a*b=c(a、b、c都是整数),那么我们称a和b就是c的计算因数。
步骤S103,在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;
接收端接收该次通信密文得到对应的解密算法因数和待解密数据,通过该解密算法因数来确定该次解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法因数和最少字节数进行计算得到该次解密密钥,使用该次解密密钥和该次解密算法对待解密数据进行解密得到该次解密数据,根据解密算法因数和该次解密数据生成该次通信明文。接收字节数计算,其在发送端计算在一定期间内到达接收侧的数据段的字节数,发送数据端控制部,其根据由所述接收字节数计算部计算出的数据段的字节数,对发送数据段数进行控制。在发送端和接收端分别预先设置一对应的对称加密算法,根据待发送数据的内容选择所采用的加密算法、采用的密钥等,不需要传输额外的密钥信息、高效快捷且安全性高。
步骤S104,接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密 钥,使用解密密钥和解密算法对待解密数据进行解密得到解密数据,根据解密算法的计算因数和解密数据生成通信明文。
在接收方,先用已知的对称密钥对加密的对称密钥解密,然后用解密的对称密钥解密密文得到原文,这样每传输一个数据包,就要进行对称密钥加密/解密各一次。
在一个实施例中,待发送数据进行加密之前还包括:确定待发送数据中各个预定字段的字段数据以及字段名称,将字段名称作为键,对应的字段数据作为值,进行组包获得数据包。
确定待发送数据中各个预定字段的字段数据以及字段名称,将字段名称作为键,对应的字段数据作为值,进行组包获得数据包,由于采用键-值格式,通过获取各个字段的字段名称作为键即可从中解析获得对应的字段数据,不存在由于各个字段之间预定顺序改变导致接收端出现解析错误,因此大大提高了数据传输的可靠性及通用性,有力于利于代码的移植和维护。将将明文序列以数据包的形式,对每一组用相同的加密算法和不同的密钥进行加密;加密后的数据包长度和明文数据包长度相同,不会增加冗余信息,适合大批量数据的加密并,保证了数据的完整性。
在一个实施例中,加密算法为对称加密算法,解密算法为与加密算法相同的对称解密算法。
对称算法,加密和解密除密钥编排不同外,使用同一算法。加密和解密的相似性,即加密和解密过程的不同仅仅在密钥使用方式上,采用相同的算法实现加密和解密,更加快速。
在一个实施例中,预定字段还包括:同步字、长度字和校验信息,其中同步字用于查询数据包开始位置,长度字用于确定数据包长度,校验信息用于校验数据包数据有效性。
预定同步字、长度字、校验信息等,同步字用于查询数据包开始位置,长度字用于确定数据包长度,校验信息用于校验数据包数据有效性,可根据实际情况增加其他数据包信息用于控制数据包数据有效合理性,读取缓存数据并查找同步字,循环查找读取的数据,直到符合同步字要求,记录当前数据位置信 息。查找长度字,查询到同步字后,找到长度字,记录当前数据位置信息及数据包长度信息,根据查询到长度信息获取相应的校验信息,校验数据包并比较和记录校验信息,相等则校验正确并组成一个完整有效数据包,否则数据包无效。
在一个实施例中,对称加密算法的公式为:密文=IP-1×fk2×SW×fk1×IP;
或,密文=IP -1(f k2(SW(f k1(IP(明文))))),
其中K 1=P8(移位(P10(密钥k))),
K 2=P8(移位(移位(P10(密钥k)))),
IP为初始置换,IP -1为初始置换IP的逆置换,
SW为交换函数,对左边和右边的4个比特进行互换,
复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,
Figure PCTCN2018104293-appb-000001
其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,密钥K和明文是两个预先输入的参数,所述密钥K是明文转换为密文或将密文转换为明文的算法中输入的数据,对明文用不同的密钥K加密的结果不一样,但使用的是相同的算法;
P8为预设的8比特密钥,P10为预设的10比特密钥。
初始置换IP和逆初始置换IP -1,将64bit明文的位置进行置换,得到一个乱序的64bit明文组,而后分成左右两段,每段为32bit,以L 0和R 0表示,IP中各列元素位置号数相差为8,相当于将原明文各字节按列写出,各列比特经过偶采样和奇采样置换后,再对各行进行逆序。将阵中元素按行读出构成置换输出。逆初始置换IP -1。将16轮迭代后给出的64bit组进行置换,得到输出的密文组。输出为阵中元素按行读得的结果。IP和IP -1的作用在于打乱原来输入x的ASCII码字划分的关系,并将原来明文的校验位x8,x16,x32,x64变成为IP输出的一个字节。交换函数SW对左边和右边的4个比特进行互换,以便第二个f k对另外4个比特进行处理。复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,函数
Figure PCTCN2018104293-appb-000002
其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,并不要求是1:1 的,SK为子密钥,所述密钥K为对称加密时预先输入的参数,密文是对称加密时生成的密文,对称解密算法是对称加密算法的逆运算。
如图2A所示,设10bit的密钥为(k 1,k 2,k 3,k 4,k 5,k 6,k 7,k 8,k 9,k 10),
如图2B所示,P10=1 2 3 4 5 6 7 8 9 10
3 5 274 101986
如图2C所示,LS-1为循环左移1位;
如图2D所示,LS-2为循环左移左移2位;
如图2E所示,P8=1 2 3 4 5 6 7 8
6 3 7 4 8 5 10 9
对称加密算法的公式为:密文=IP-1×fk2×SW×fk1×IP;
或则是,密文=IP -1(f k2(SW(f k1(IP(明文))))),
其中K 1=P8(移位(P10(密钥k))),
K 2=P8(移位(移位(P10(密钥k))))。
在一个实施例中,对称解密算法的公式为:明文=IP -1(f k1(SW(f k2(IP(密文))))),
IP为初始置换,IP -1为初始置换IP的逆置换,
SW为交换函数,对左边和右边的4个比特进行互换,
复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,
Figure PCTCN2018104293-appb-000003
其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,所述密钥K为对称加密时预先输入的参数,密文是对称加密时生成的密文,对称解密算法是对称加密算法的逆运算。
明文=IP -1(f k1(SW(f k2(IP(密文)))))。
初始置换用IP函数:
IP=1 2 3 4 5 6 7 8
2 6 3 1 4 8 5 7
末端算法的置换为IP的逆置换:
IP -1=1 2 3 4 5 6 7 8
4 1 3 5 7 2 8 6
如图3所示,在一个实施例中,提出了一种加密装置,所述加密装置包括:
发送设置单元,设置为在发送端设置加密算法以及加密算法的密钥所需的最小字节数;
加密单元,设置为发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端;
接收设置单元,设置为在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;
解密单元,设置为接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密钥,使用解密密钥和解密算法对待解密数据进行解密得到解密数据,根据解密算法的计算因数和解密数据生成通信明文。
在一个实施例中,所述加密单元还设置为确定待发送数据中各个预定字段的字段数据以及字段名称,将所述字段名称作为键,对应的字段数据作为值,进行组包获得数据包。
在一个实施例中,所述加密算法为对称加密算法,所述解密算法为与所述加密算法相同的对称解密算法。
在一个实施例中,所述预定字段还包括:同步字、长度字和校验信息,其中同步字用于查询数据包开始位置,长度字用于确定数据包长度,校验信息用于校验数据包数据有效性。
在一个实施例中,所述对称加密算法的公式为:密文=IP -1×f k2×SW×f k1×IP;
或,密文=IP -1(f k2(SW(f k1(IP(明文))))),
其中K 1=P8(移位(P10(密钥k))),
K 2=P8(移位(移位(P10(密钥k)))),
IP为初始置换,IP -1为初始置换IP的逆置换,
SW为交换函数,对左边和右边的4个比特进行互换,
复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,
Figure PCTCN2018104293-appb-000004
其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,密钥K和明文是两个预先输入的参数,所述密钥K是明文转换为密文或将密文转换为明文的算法中输入的数据,对明文用不同的密钥K加密的结果不一样,但使用的是相同的算法;
P8为预设的8比特密钥,P10为预设的10比特密钥。
在一个实施例中,所述对称解密算法的公式为:明文=IP -1(f k1(SW(f k2(IP(密文))))),
IP为初始置换,IP -1为初始置换IP的逆置换,
SW为交换函数,对左边和右边的4个比特进行互换,
其中K 1=P8(移位(P10(密钥k))),
K 2=P8(移位(移位(P10(密钥k)))),
复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,
Figure PCTCN2018104293-appb-000005
其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,所述密钥K为对称加密时预先输入的参数,密文是对称加密时生成的密文,对称解密算法是对称加密算法的逆运算。
在一个实施例中,提出了一种计算机设备,所述计算机设备包括存储器和处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时,使得处理器执行所述计算机程序时实现上述各实施例里加密方法中的步骤。
在一个实施例中,提出了一种存储有计算机可读指令的存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述各实施例里加密方法中的步骤。其中,存储介质可以为非易失性存储介质。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请一些示例性实施例,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种加密方法,包括:
    在发送端设置加密算法以及加密算法的密钥所需的最小字节数;
    发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端;
    在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;
    接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密钥,使用解密密钥和解密算法对待解密数据进行解密得到解密数据,根据解密算法的计算因数和解密数据生成通信明文。
  2. 根据权利要求1所述的加密方法,其中,所述待发送数据进行加密之前还包括:
    确定待发送数据中各个预定字段的字段数据以及字段名称,将所述字段名称作为键,对应的字段数据作为值,进行组包获得数据包。
  3. 根据权利要求1所述的加密方法,其中,所述加密算法为对称加密算法,所述解密算法为与所述加密算法相同的对称解密算法。
  4. 根据权利要求2所述的方法,其中,所述预定字段还包括:同步字、长度字和校验信息,其中同步字用于查询数据包开始位置,长度字用于确定数据包长度,校验信息用于校验数据包数据有效性。
  5. 根据权利要求3所述的加密方法,其中,所述对称加密算法的公式为:密文=IP -1×f k2×SW×f k1×IP;
    或,密文=IP -1(f k2(SW(f k1(IP(明文))))),
    其中K 1=P8(移位(P10(密钥k))),
    K 2=P8(移位(移位(P10(密钥k)))),
    IP为初始置换,IP -1为初始置换IP的逆置换,
    SW为交换函数,对左边和右边的4个比特进行互换,
    复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代 运算,
    Figure PCTCN2018104293-appb-100001
    其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,密钥K和明文是两个预先输入的参数,所述密钥K是明文转换为密文或将密文转换为明文的算法中输入的数据,对明文用不同的密钥K加密的结果不一样,但使用的是相同的算法;
    P8为预设的8比特密钥,P10为预设的10比特密钥。
  6. 根据权利要求3所述的加密方法,其中,所述对称解密算法的公式为:明文=IP -1(f k1(SW(f k2(IP(密文))))),
    IP为初始置换,IP -1为初始置换IP的逆置换,
    SW为交换函数,对左边和右边的4个比特进行互换,
    其中K 1=P8(移位(P10(密钥k))),
    K 2=P8(移位(移位(P10(密钥k)))),
    复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,
    Figure PCTCN2018104293-appb-100002
    其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,所述密钥K为对称加密时预先输入的参数,密文是对称加密时生成的密文,对称解密算法是对称加密算法的逆运算。
  7. 一种加密装置,包括:
    发送设置单元,设置为在发送端设置加密算法以及加密算法的密钥所需的最小字节数;
    加密单元,设置为发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端;
    接收设置单元,设置为在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;
    解密单元,设置为接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密钥,使用解密密钥和解密算法对待解密数据进行解密得到解密数据,根 据解密算法的计算因数和解密数据生成通信明文。
  8. 根据权利要求7所述的加密装置,其中,所述加密单元还设置为确定待发送数据中各个预定字段的字段数据以及字段名称,将所述字段名称作为键,对应的字段数据作为值,进行组包获得数据包。
  9. 根据权利要求7所述的加密装置,其中,所述加密算法为对称加密算法,所述解密算法为与所述加密算法相同的对称解密算法。
  10. 根据权利要求8所述的加密装置,其中,所述预定字段还包括:同步字、长度字和校验信息,其中同步字用于查询数据包开始位置,长度字用于确定数据包长度,校验信息用于校验数据包数据有效性。
  11. 根据权利要求9所述的加密装置,其中,所述对称加密算法的公式为:密文=IP -1×f k2×SW×f k1×IP;
    或,密文=IP -1(f k2(SW(f k1(IP(明文))))),
    其中K 1=P8(移位(P10(密钥k))),
    K 2=P8(移位(移位(P10(密钥k)))),
    IP为初始置换,IP -1为初始置换IP的逆置换,
    SW为交换函数,对左边和右边的4个比特进行互换,
    复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,
    Figure PCTCN2018104293-appb-100003
    其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,密钥K和明文是两个预先输入的参数,所述密钥K是明文转换为密文或将密文转换为明文的算法中输入的数据,对明文用不同的密钥K加密的结果不一样,但使用的是相同的算法;
    P8为预设的8比特密钥,P10为预设的10比特密钥。
  12. 根据权利要求9所述的加密装置,其中,所述对称解密算法的公式为:明文=IP -1(f k1(SW(f k2(IP(密文))))),
    IP为初始置换,IP -1为初始置换IP的逆置换,
    SW为交换函数,对左边和右边的4个比特进行互换,
    其中K 1=P8(移位(P10(密钥k))),
    K 2=P8(移位(移位(P10(密钥k)))),
    复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,
    Figure PCTCN2018104293-appb-100004
    其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,所述密钥K为对称加密时预先输入的参数,密文是对称加密时生成的密文,对称解密算法是对称加密算法的逆运算。
  13. 一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
    在发送端设置加密算法以及加密算法的密钥所需的最小字节数;
    发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端;
    在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;
    接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密钥,使用解密密钥和解密算法对待解密数据进行解密得到解密数据,根据解密算法的计算因数和解密数据生成通信明文。
  14. 根据权利要求13所述的计算机设备,其中,所述加密算法为对称加密算法,所述解密算法为与所述加密算法相同的对称解密算法。
  15. 根据权利要求14所述的计算机设备,其中,所述对称加密算法的公式为:密文=IP -1×f k2×SW×f k1×IP;
    或,密文=IP -1(f k2(SW(f k1(IP(明文))))),
    其中K 1=P8(移位(P10(密钥k))),
    K 2=P8(移位(移位(P10(密钥k)))),
    IP为初始置换,IP -1为初始置换IP的逆置换,
    SW为交换函数,对左边和右边的4个比特进行互换,
    复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代 运算,
    Figure PCTCN2018104293-appb-100005
    其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,密钥K和明文是两个预先输入的参数,所述密钥K是明文转换为密文或将密文转换为明文的算法中输入的数据,对明文用不同的密钥K加密的结果不一样,但使用的是相同的算法;
    P8为预设的8比特密钥,P10为预设的10比特密钥。
  16. 根据权利要求14所述的计算机设备,其中,所述对称解密算法的公式为:明文=IP -1(f k1(SW(f k2(IP(密文))))),
    IP为初始置换,IP -1为初始置换IP的逆置换,
    SW为交换函数,对左边和右边的4个比特进行互换,
    其中K 1=P8(移位(P10(密钥k))),
    K 2=P8(移位(移位(P10(密钥k)))),
    复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,
    Figure PCTCN2018104293-appb-100006
    其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,所述密钥K为对称加密时预先输入的参数,密文是对称加密时生成的密文,对称解密算法是对称加密算法的逆运算。
  17. 一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
    在发送端设置加密算法以及加密算法的密钥所需的最小字节数;
    发送端使用加密算法和加密密钥对待发送数据进行加密得到加密数据,根据加密算法的计算因数和加密数据生成通信密文,将通信密文通过网络发送至接收端;
    在接收端对应设置解密算法和解密算法的密钥所需的最小字节数;
    接收端接收通信密文得到对应的解密算法的计算因数和待解密数据,通过该解密算法的计算因数来确定解密算法和对应算法的密钥所需的最小字节数,而后再根据解密算法的计算因数和最小字节数进行计算得到解密密钥,使用解密密钥和解密算法对待解密数据进行解密得到解密数据,根据解密算法的计算因数和解密数据生成通信明文。
  18. 根据权利要求17所述的存储介质,其中,所述加密算法为对称加密算法,所述解密算法为与所述加密算法相同的对称解密算法。
  19. 根据权利要求17所述的存储介质,其中,所述对称加密算法的公式为:密文=IP -1×f k2×SW×f k1×IP;
    或,密文=IP -1(f k2(SW(f k1(IP(明文))))),
    其中K 1=P8(移位(P10(密钥k))),
    K 2=P8(移位(移位(P10(密钥k)))),
    IP为初始置换,IP -1为初始置换IP的逆置换,
    SW为交换函数,对左边和右边的4个比特进行互换,
    复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,
    Figure PCTCN2018104293-appb-100007
    其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,密钥K和明文是两个预先输入的参数,所述密钥K是明文转换为密文或将密文转换为明文的算法中输入的数据,对明文用不同的密钥K加密的结果不一样,但使用的是相同的算法;
    P8为预设的8比特密钥,P10为预设的10比特密钥。
  20. 根据权利要求17所述的存储介质,其中,所述对称解密算法的公式为:明文=IP -1(f k1(SW(f k2(IP(密文))))),
    IP为初始置换,IP -1为初始置换IP的逆置换,
    SW为交换函数,对左边和右边的4个比特进行互换,
    其中K 1=P8(移位(P10(密钥k))),
    K 2=P8(移位(移位(P10(密钥k)))),
    复合轮函数f k1和复合轮函数f k2,分别由密钥K 1和K 2确定,负责置换和替代运算,
    Figure PCTCN2018104293-appb-100008
    其中L,R为8位输入,左右各为4位,F为从4位集到4位集的一个映射,SK为子密钥,所述密钥K为对称加密时预先输入的参数,密文是对称加密时生成的密文,对称解密算法是对称加密算法的逆运算。
PCT/CN2018/104293 2018-05-21 2018-09-06 加密方法、装置、计算机设备和存储介质 WO2019223170A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810485850.3A CN108667599A (zh) 2018-05-21 2018-05-21 加密方法、装置、计算机设备和存储介质
CN201810485850.3 2018-05-21

Publications (1)

Publication Number Publication Date
WO2019223170A1 true WO2019223170A1 (zh) 2019-11-28

Family

ID=63776216

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/104293 WO2019223170A1 (zh) 2018-05-21 2018-09-06 加密方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN108667599A (zh)
WO (1) WO2019223170A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
PL3552158T3 (pl) * 2018-11-27 2021-07-26 Advanced New Technologies Co., Ltd. System i sposób ochrony informacji
CN114362919A (zh) * 2020-09-30 2022-04-15 深圳君正时代集成电路有限公司 一种对称加解密算法分包处理方法
CN114812528B (zh) * 2022-06-24 2022-10-14 湖北高路公路工程监理咨询有限公司 一种运用在高速公路病害边坡上的自动监测系统
CN116132079A (zh) * 2022-08-09 2023-05-16 马上消费金融股份有限公司 数据处理方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010091565A1 (zh) * 2009-02-12 2010-08-19 Liu Haiyun 需要采用穷举法解密的随机加密方法
CN103905187A (zh) * 2012-12-26 2014-07-02 厦门雅迅网络股份有限公司 一种基于内容的网络通信加密方法
CN105262772A (zh) * 2015-11-06 2016-01-20 腾讯科技(深圳)有限公司 一种数据传输方法、系统及相关装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106664206B (zh) * 2014-06-18 2020-05-12 维萨国际服务协会 用于已认证的通信的高效方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010091565A1 (zh) * 2009-02-12 2010-08-19 Liu Haiyun 需要采用穷举法解密的随机加密方法
CN103905187A (zh) * 2012-12-26 2014-07-02 厦门雅迅网络股份有限公司 一种基于内容的网络通信加密方法
CN105262772A (zh) * 2015-11-06 2016-01-20 腾讯科技(深圳)有限公司 一种数据传输方法、系统及相关装置

Also Published As

Publication number Publication date
CN108667599A (zh) 2018-10-16

Similar Documents

Publication Publication Date Title
KR102432299B1 (ko) 양자 키 분배에 기초하는 암호화 및 복호화를 위한 시스템 및 방법
US8401186B2 (en) Cloud storage data access method, apparatus and system based on OTP
US9112699B1 (en) System, processing device, computer program and method, to tranparently encrypt and store data objects such that owners of the data object and permitted viewers are able to view decrypted data objects after entering user selected passwords
WO2019223170A1 (zh) 加密方法、装置、计算机设备和存储介质
US8358781B2 (en) Nonlinear feedback mode for block ciphers
CN105610793B (zh) 一种外包数据加密存储与密文查询系统及其应用方法
US6185304B1 (en) Method and apparatus for a symmetric block cipher using multiple stages
US8180048B2 (en) Method and system for computational transformation
CN109617677A (zh) 基于对称加密的秘钥丢失找回方法及相关设备
JP2014017556A5 (zh)
Stallings NIST block cipher modes of operation for confidentiality
WO2019223169A1 (zh) 加密方法、装置、计算机设备和存储介质
US20110182419A1 (en) Encryption algorithm with randomized buffer
Huang et al. Differential-linear cryptanalysis of ICEPOLE
US20090010433A1 (en) Schryption method and device
Stallings NIST block cipher modes of operation for authentication and combined confidentiality and authentication
CN114443718A (zh) 一种数据查询方法及系统
Mendonca Data security in cloud using AES
CN113726512A (zh) 密钥生成和分发方法、密钥生成装置、密钥管理系统
Gupta et al. Enhancement of Cloud Security and removal of anti-patterns using multilevel encryption algorithms.
CN104794243A (zh) 基于文件名的第三方密文检索方法
CN109923829A (zh) 对秘密值达成一致
CN115277064B (zh) 数据加密、数据解密方法、装置、电子设备和介质
CN115766244A (zh) 车联网信息加密方法、装置、计算机设备和存储介质
CN115828300A (zh) 基于区块链的带隐私保护的政务信息处理方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18919633

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22/03/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18919633

Country of ref document: EP

Kind code of ref document: A1