Unlock instant, AI-driven research and patent intelligence for your innovation.

A packet encryption and decryption method and device

A technology of encryption, decryption and configuration methods, which is applied in the field of information security and can solve problems such as poor security

Active Publication Date: 2019-05-10
北京思源理想控股集团有限公司
View PDF7 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, in the prior art, encryption and decryption are performed directly through the original key through cyclic calculation, which has poor security.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A packet encryption and decryption method and device
  • A packet encryption and decryption method and device
  • A packet encryption and decryption method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0057] Such as figure 1 As shown, the embodiment of the present invention provides a packet encryption and decryption method, including:

[0058] Step 101, the round key rk in the standard SM4 algorithm i Split into 4 bytes, recorded as rk i =(rk i0 ,rk i1 ,rk i2 ,rk i3 ).

[0059] In this embodiment, the standard SM4 algorithm has a total of 32 round keys, that is, in step 101, i represents the number of iterative calculation rounds, i is an integer, and i satisfies 0≤i≤31.

[0060] Step 102, remember Will L i Split into 4 bytes, denoted as L i =(a i0 ,a i1 ,a i2 ,a i3 ).

[0061] In this embodiment, in step 102 Exclusive OR; X i+1 is the i+1 round ciphertext; X i+2 is the i+2 round ciphertext; X i+3 is the i+3 round ciphertext.

[0062] Step 103, with Build the corresponding lookup table Tbox i0 ,Tbox i1 ,Tbox i2 ,Tbox i3 .

[0063] In this embodiment, Tbox in step 103 ij for Corresponding lookup table; j is an integer, and j satisfies 0≤j≤3. ...

Embodiment 2

[0077] Such as image 3 As shown, the embodiment of the present invention provides a packet encryption and decryption method, including:

[0078] Step 301 to step 305, build lookup table Tbox i0 ,Tbox i1 ,Tbox i2 ,Tbox i3 and W box W(x), and according to W box W(x) and lookup table Tbox i0 ,Tbox i1 ,Tbox i2 ,Tbox i3 Construct lookup table TW box TW i . The process is related to figure 1 Steps 101 to 105 shown are similar and will not be repeated here.

[0079] Step 306, each round of operation randomly generates four 8-bit random numbers Z i0 ,Z i1 ,Z i2 ,Z i3 .

[0080] In this embodiment, in order to improve the security of encryption and decryption operations, in 32 rounds of iterative operations, each round randomly generates a set of random numbers Z through step 306 i0 ,Z i1 ,Z i2 ,Z i3 . Preferably, in order to ensure that all Z in 32 rounds of iterative operations ij (0≤j≤3) are different, can generate 32*4 byte random numbers at one time, take 4 b...

Embodiment 3

[0092] Such as Figure 5 As shown, the embodiment of the present invention provides a packet encryption method, including:

[0093] Step 501, remember Will M t Split into 4 bytes, denoted as M t =(b t0 ,b t1 ,b t2 ,b t3 ).

[0094] In this embodiment, t in step 501 is an integer, and t satisfies 0≤t≤31, Y 0 ,Y 1 ,Y 2 ,Y 3 4 32bit words split for plaintext; Y t+1 is the t+1th round ciphertext; Y t+2 is the t+2 round ciphertext; Y t+3 It is the ciphertext of the t+3th round.

[0095] Step 502, respectively with b t0 ,b t1 ,b t2 ,b t3 To TW cassette TW i Perform table lookup operation to get B t0 ,B t1 ,B t2 ,B t3 .

[0096] In this embodiment, in step 502, TW box TW i is generated, with figure 1 Steps 101 to 105 shown are similar and will not be repeated here.

[0097] Step 503, according to C and D, set B t0 ,B t1 ,B t2 ,B t3 Convert to U t .

[0098] In this embodiment, the acquisition process of C and D is the same as figure 2 The steps 107...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a packet encryption and decryption method and device, and relates to the field of information security. The method and the device are invented for solving the problem of poor security due to the fact that encryption and decryption are directly carried out through circular calculation of an original key in the prior art. The method comprises the steps that 32 rounds of iterative computation are carried out according to a pre-generated lookup table, and the process of generating the lookup table comprises the steps that a round key rki in a standard SM4 algorithm is splitinto four bytes, and the four bytes are recorded as rki = (rki 0, rki 1, rki 2 and rki 3); dividing Li into four bytes, and recording the four bytes as Li = (ai0, ai1, ai2 and ai3); Constructing a corresponding lookup table Tboxi0, Tboxi1, Tboxi2, Tboxi3; Constructing a W box W (x); constructing W box W(x); constructing a lookup table TW box TWi according to the W box W(x) and lookup tables Tboxi0, Tboxi1, Tboxi2, Tboxi3..

Description

technical field [0001] The invention relates to the field of information security, in particular to a packet encryption and decryption method and device. Background technique [0002] Data encryption is a fundamental task of cryptosystems. According to the relationship between the encryption key and the decryption key, data encryption can be divided into two categories: symmetric cryptography and public key cryptography. SM4 is a symmetric cipher encryption algorithm, which belongs to block encryption. The length of the plaintext, key and ciphertext of this algorithm is 128 bits. The algorithm implements encryption and decryption through 32 nonlinear iterations. [0003] However, in the prior art, encryption and decryption are performed directly through cyclic calculation with the original key, and the security is poor. Contents of the invention [0004] The purpose of the present invention is to provide a packet encryption and decryption method and device, which can imp...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): H04L9/06H04L9/08
Inventor 程威全勇
Owner 北京思源理想控股集团有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More