CN111740816A - BWGCF block cipher algorithm realizing method - Google Patents

BWGCF block cipher algorithm realizing method Download PDF

Info

Publication number
CN111740816A
CN111740816A CN201910225576.0A CN201910225576A CN111740816A CN 111740816 A CN111740816 A CN 111740816A CN 201910225576 A CN201910225576 A CN 201910225576A CN 111740816 A CN111740816 A CN 111740816A
Authority
CN
China
Prior art keywords
value
key
equal
algorithm
length
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
Application number
CN201910225576.0A
Other languages
Chinese (zh)
Other versions
CN111740816B (en
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.)
Shandong Wenbin Information Security Technology Co ltd
Original Assignee
Shandong Wenbin Information Security 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 Shandong Wenbin Information Security Technology Co ltd filed Critical Shandong Wenbin Information Security Technology Co ltd
Priority to CN201910225576.0A priority Critical patent/CN111740816B/en
Publication of CN111740816A publication Critical patent/CN111740816A/en
Application granted granted Critical
Publication of CN111740816B publication Critical patent/CN111740816B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0625Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation with splitting of the data block into left and right halves, e.g. Feistel based algorithms, DES, FEAL, IDEA or KASUMI

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Facsimile Transmission Control (AREA)

Abstract

The invention discloses a BWGCF block cipher algorithm implementation method, belongs to the technical field of information security, and relates to cipher algorithm design. The BWGCF block cipher algorithm realizing method of the invention is composed of 4 algorithms of BWGCF algorithm control and selection algorithm, BWGCF algorithm T function construction algorithm, BWGCF algorithm encryption algorithm and BWGCF algorithm key expansion algorithm, and the specific implementation mode of the 4 algorithms is provided. The packet length/key length support for BWGCF packet cipher algorithms 128/128, 128/256, and 256/256.

Description

BWGCF block cipher algorithm realizing method
Technical Field
The invention belongs to the technical field of information security, and relates to a cryptographic algorithm design.
Background
Since the cryptographic technology is the foundation of information security, all countries have paid great attention to the research of cryptographic algorithms. In such an age, passwords have entered open competition and international cooperation by secret antagonism.
The BWGCF cryptographic algorithm is an iterative block cipher algorithm. The packet length/key length support of the algorithm 128/128, 128/256 and 256/256, the basic topology of the BWGCF cryptographic algorithm consists of sixteen eight-level feedback polynomials, which are all primitive polynomials, and they are:
(1)f(x)=x8+x4+x3+x2+1
(2)f(x)=x8+x5+x3+x1+1
(3)f(x)=x8+x5+x3+x2+1
(4)f(x)=x8+x6+x3+x2+1
(5)f(x)=x8+x6+x4+x3+x2+x1+1
(6)f(x)=x8+x6+x5+x1+1
(7)f(x)=x8+x6+x5+x2+1
(8)f(x)=x8+x6+x5+x3+1
(9)f(x)=x8+x6+x5+x4+1
(10)f(x)=x8+x7+x2+x1+1
(11)f(x)=x8+x7+x3+x2+1
(12)f(x)=x8+x7+x5+x3+1
(13)f(x)=x8+x7+x6+x1+1
(14)f(x)=x8+x7+x6+x3+x2+x1+1
(15)f(x)=x8+x7+x6+x5+x2+x1+1
(16)f(x)=x8+x7+x6+x5+x4+x2+1
the BWGCF cryptographic algorithm follows the design idea of DP logic, D is Drive, namely the driving part of the block cipher, where D is the above 16 eight-level primitive polynomials, P is Permutation, each beat is Permutation, and the composition of beats is still Permutation; following the design idea of orthomorphism; according to the algorithm reconstruction design idea, the feedback polynomial selected by each beat is randomly selected by key control, and the total reconfigurable space size is 24×l(l is the number of beats), the 128bit key can actually reach 264The above is not heavy. The block cipher algorithm conforms to a generalized Feistel structure, DES, GHOST, SM4 and CAST belong to the Feistel or the generalized Feistel structure, and is the inheritance and development of the generalized Feistel structure, particularly the further development of SM 4; the P logic design idea is followed, namely the design logic of the key control random permutation operator. The algorithm fully embodies the high unification of the design idea of the sequence password and the design idea of the block password.
Disclosure of Invention
The BWGCF block cipher realization method of the invention is composed of the following four algorithms:
algorithm 1: BWGCF algorithm control selection algorithm;
and 2, algorithm: BWGCF algorithm T function construction algorithm;
algorithm 3: BWGCF algorithm encryption algorithm;
and algorithm 4: BWGCF algorithm key expansion algorithm.
Drawings
The attached drawing isBasic topological structure diagram of BWGCF block cipher algorithm
Detailed Description
The BWGCF block cipher algorithm implementation method of the invention is composed of the following 4 algorithms, and the specific implementation mode of each algorithm is as follows:
algorithm 1: BWGCF algorithm control and selection algorithm
Let the subkey be k0,k1,k2,k3,...,kL-1Then the BWGCF control selection algorithm is:
W=ki0+2×ki1+4×ki2+8×ki3
wherein k isi3,ki2,ki1,ki0Is a subkey kiThe last four bits.
And 2, algorithm: t function construction algorithm of BWGCF algorithm
(1) Packet length/key length 128/128
T is
Figure RE-GSB0000182065610000021
The transformation of (2) is a fixed composite permutation independent of the key, and is composed of a nonlinear transformation layer and a linear transformation layer.
1) Non-linear transformation tau
The non-linear transform τ is made up of 2 parallel 8 x 8S-boxes, actually byte-instead transforms.
Let the input be
Figure RE-GSB0000182065610000022
Output is as
Figure RE-GSB0000182065610000023
Then
(b0,b1)=τ(A)=(sbox(a0),sbox(a1)).
2) Linear transformation A
The output of the nonlinear transformation τ is the input of the linear transformation a (satisfying that both the linear and differential branch numbers are 3). Let the input be
Figure RE-GSB0000182065610000024
Output is as
Figure RE-GSB0000182065610000025
Then
Figure RE-GSB0000182065610000026
S-box production mode:
S-Box affine equivalent to finite field GF (2)8) The multiplicative inverse function of (1).
The reversible affine transformation pi over GF (2) is defined as follows:
let input 8-bit variable a ═ a0,a1,...,a7) And outputting 8-bit variable b ═ pi (a) ═ b0,b1,...,b7) Then, then
Figure RE-GSB0000182065610000027
Defining a finite field GF (2)8) The inverse of the multiplication in (1) is as follows:
under GF (2)8) In the middle of using primitive polynomial
g(x)=x8+x7+x6+x5+x4+x2+1,
Mapping x to x-1And "00" maps to itself.
The production mode of the S-box is as follows:
input device
Figure RE-GSB0000182065610000031
Output of
Figure RE-GSB0000182065610000032
Then
y=sbox(x)=π(f(π(x))).
The S-box is as follows:
0 1 2 3 4 5 6 7 8 9 a b c d e f
0 d6 90 e9 fe cc e1 3d b7 16 b6 14 c2 28 fb 2c 05
1 2b 67 9a 76 2a be 04 c3 aa 44 13 26 49 86 06 99
2 9c 42 50 f4 91 ef 98 7a 33 54 0b 43 ed cf ac 62
3 e4 b3 1c a9 c9 08 e8 95 80 df 94 fa 75 8f 3f a6
4 47 07 a7 fc f3 73 17 ba 83 59 3c 19 e6 85 4f a8
5 68 6b 81 b2 71 64 da 8b f8 eb 0f 4b 70 56 9d 35
6 1e 24 0e 5e 63 58 d1 a2 25 22 7c 3b 01 21 78 87
7 d4 00 46 57 9f d3 27 52 4c 36 02 e7 a0 c4 c8 9e
8 ea bf 8a d2 40 c7 38 b5 a3 f7 f2 ce f9 61 15 a1
9 e0 ae 5d a4 9b 34 1a 55 ad 93 32 30 f5 8c b1 e3
a 1d f6 e2 2e 82 66 ca 60 c0 29 23 ab 0d 53 4e 6f
b d5 db 37 45 de fd 8e 2f 03 ff 6a 72 6d 6c 5b 51
c 8d 1b af 92 bb dd bc 7f 11 d9 5c 41 1f 10 5a d8
d 0a c1 31 88 a5 cd 7b bd 2d 74 d0 12 b8 e5 b4 b0
e 89 69 97 4a 0c 96 77 7e 65 b9 f1 09 c5 6e c6 84
f 18 f0 7d ec 3a dc 4d 20 79 ee 5f 3e d7 cb 39 48
(2) packet length/key length 128/256
The T function of the packet length/key length of 128/256 is the same as the T function of the packet length/key length of 128/128.
(3) Packet length/key length 256/256
T is
Figure RE-GSB0000182065610000033
The transformation of (2) is a fixed composite permutation independent of the key, and is composed of a nonlinear transformation layer and a linear transformation layer.
1) Non-linear transformation tau
The non-linear transform τ is made up of 2 parallel 16 x 16S-boxes, actually a two-byte substitution transform.
Let the input be
Figure RE-GSB0000182065610000034
Output is as
Figure RE-GSB0000182065610000035
Then
(b0,b1)=τ(A)=(sbox(a0),sbox(a1)).
2) Linear transformation A
The output of the nonlinear transformation τ is the input of the linear transformation a (satisfying that both the linear and differential branch numbers are 3). Let the input be
Figure RE-GSB0000182065610000036
Output is as
Figure RE-GSB0000182065610000037
Then
Figure RE-GSB0000182065610000038
S-box production mode:
defining a finite field GF (2)16) The inverse of the multiplication in (1) is as follows:
under GF (2)16) In the middle of using primitive polynomial
g(x)=x16+x5+x3+x+1,
Mapping x to x-1And "00" maps to itself.
Algorithm 3: BWGCF algorithm encryption algorithm
(1) Packet length/key length 128/128
The encryption algorithm for packet length/key length 128/128 is as follows:
1) round key expansion is carried out on the 128-bit basic key to generate a sub-key k0,k1,...,k47
2) Let 128 bits plaintext input as
Figure RE-GSB0000182065610000041
The ciphertext is output as
Figure RE-GSB0000182065610000042
Calculating W ═ ki0+2×ki1+4×ki2+8×ki3Wherein k isi3,ki2,ki1,ki0Is a subkey kiThe last four bits of (i ═ 0, 1.., 47).
If WiWhen the value is equal to 0, then
Figure RE-GSB0000182065610000043
If Wi1, then
Figure RE-GSB0000182065610000044
If WiWhen 2, then
Figure RE-GSB0000182065610000045
If WiWhen being equal to 3, then
Figure RE-GSB0000182065610000046
If WiWhen the value is 4, then
Figure RE-GSB0000182065610000047
If WiWhen the value is 5, then
Figure RE-GSB0000182065610000048
If WiWhen the value is 6, then
Figure RE-GSB0000182065610000049
If WiWhen being equal to 7, then
Figure RE-GSB00001820656100000410
If WiWhen it is equal to 8, then
Figure RE-GSB00001820656100000411
If WiWhen the result is 9, then
Figure RE-GSB00001820656100000412
If WiWhen the value is 10, then
Figure RE-GSB00001820656100000413
If WiWhen it is equal to 11, then
Figure RE-GSB00001820656100000414
If WiWhen the value is 12, then
Figure RE-GSB00001820656100000415
If WiWhen it is 13, then
Figure RE-GSB00001820656100000416
If WiWhen the value is 14, then
Figure RE-GSB00001820656100000417
If Wi15, then
Figure RE-GSB00001820656100000418
3) The state of the register is the ciphertext when the BWGCF algorithm moves 48 beats, namely
(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)=(X48,X49,X50,X51,X52,X53,X54,X55).
(2) Packet length/key length 128/256
The encryption algorithm for packet length/key length 128/256 is the same as the encryption algorithm for packet length/key length 128/128.
(3) Packet length/key length 128/256
The encryption algorithm for packet length/key length 256/256 is as follows:
1) round key expansion is carried out on the 256-bit basic key to generate a sub-key k0,k1,...,k31
2) Let 256 bits plaintext input be
Figure RE-GSB00001820656100000419
The ciphertext is output as
Figure RE-GSB00001820656100000420
Calculating W ═ ki0+2×ki1+4×ki2+8×ki3Wherein k isi3,ki2,ki1,ki0Is a subkey kiThe last four bits of (i ═ 0, 1.., 31).
If WiWhen the value is equal to 0, then
Figure RE-GSB00001820656100000421
If Wi1, then
Figure RE-GSB00001820656100000422
If WiWhen 2, then
Figure RE-GSB00001820656100000423
If WiWhen being equal to 3, then
Figure RE-GSB0000182065610000051
If WiWhen the value is 4, then
Figure RE-GSB0000182065610000052
If WiWhen the value is 5, then
Figure RE-GSB0000182065610000053
If WiWhen the value is 6, then
Figure RE-GSB0000182065610000054
If WiWhen being equal to 7, then
Figure RE-GSB0000182065610000055
If WiWhen it is equal to 8, then
Figure RE-GSB0000182065610000056
If WiWhen the result is 9, then
Figure RE-GSB0000182065610000057
If WiWhen the value is 10, then
Figure RE-GSB0000182065610000058
If WiWhen it is equal to 11, then
Figure RE-GSB0000182065610000059
If WiWhen the value is 12, then
Figure RE-GSB00001820656100000510
If WiWhen it is 13, then
Figure RE-GSB00001820656100000511
If WiWhen the value is 14, then
Figure RE-GSB00001820656100000512
If Wi15, then
Figure RE-GSB00001820656100000513
3) The state of the register is the ciphertext when the BWGCF algorithm moves 32 beats, namely
(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)=(X32,X33,X34,X35,X36,X37,X38,X39).
(4) Decryption algorithm
And (5) inverting the ciphertext to obtain the plaintext.
And algorithm 4: BWGCF algorithm key expansion algorithm
(1) Packet length/key length 128/128
The encryption key is denoted as (MK)0,MK1,MK2,MK3,MK4,MK5,MK6,MK7)(
Figure RE-GSB00001820656100000522
(i= 0,1,2,3,4,5,6,7))。
If the encryption key is represented by bytes as (d)0,d1,...,d15) Then, then
MK0=(d0,d1),
MK1=(d2,d3),
MK2=(d4,d5),
MK3=(d6,d7),
MK4=(d8,d9),
MK5=(d10,d11),
MK6=(d12,d13),
MK7=(d14,d15).
Order to
Figure RE-GSB00001820656100000514
The subkey is
Figure RE-GSB00001820656100000515
The subkey generation is as follows:
firstly, the method
Figure RE-GSB00001820656100000516
Figure RE-GSB00001820656100000517
Figure RE-GSB00001820656100000518
Figure RE-GSB00001820656100000519
Figure RE-GSB00001820656100000520
Figure RE-GSB00001820656100000521
Figure RE-GSB0000182065610000061
Figure RE-GSB0000182065610000062
Then, let W be 0, 1, 2i(i ═ 0, 1.., 47) is Ki+7The last 4 bits of (b) correspond to integers:
if WiWhen the value is equal to 0, then
Figure RE-GSB0000182065610000063
If Wi1, then
Figure RE-GSB0000182065610000064
If WiWhen 2, then
Figure RE-GSB0000182065610000065
If WiWhen being equal to 3, then
Figure RE-GSB0000182065610000066
If WiWhen the value is 4, then
Figure RE-GSB0000182065610000067
If WiWhen the value is 5, then
Figure RE-GSB0000182065610000068
If WiWhen the value is 6, then
Figure RE-GSB0000182065610000069
If WiWhen being equal to 7, then
Figure RE-GSB00001820656100000610
If WiWhen it is equal to 8, then
Figure RE-GSB00001820656100000611
If WiWhen the result is 9, then
Figure RE-GSB00001820656100000612
If WiWhen the value is 10, then
Figure RE-GSB00001820656100000613
If WiWhen it is equal to 11, then
Figure RE-GSB00001820656100000614
If WiWhen the value is 12, then
Figure RE-GSB00001820656100000615
If WiWhen it is 13, then
Figure RE-GSB00001820656100000616
If WiWhen the value is 14, then
Figure RE-GSB00001820656100000617
If Wi15, then
Figure RE-GSB00001820656100000618
Description of the drawings:
1) the T' transformation is the same as T in the round function of the encryption algorithm;
2)CKifor the fixed key, the value method is as follows:
let cki,jIs a fixed key CKiI.e., the j-th byte (i 0, 1.., 47; j 0, 1), i.e., the data of the first byte (i)
Figure RE-GSB00001820656100000619
Ck is theni,j=(4i+j)×7(mod 256)。
(2) Packet length/key length 128/256
The first 128 bits of the encryption key are denoted as (MK)0,MK1,MK2,MK3,MK4,MK5,MK6,MK7)(
Figure RE-GSB00001820656100000620
(i= 0,1,2,3,4,5,6,7))。
If the encryption key is represented by bytes as (d)0,d1,...,d15) Then, then
MK0=(d0,d1),
MK1=(d2,d3),
MK2=(d4,d5),
MK3=(d6,d7),
MK4=(d8,d9),
MK5=(d10,d11),
MK6=(d12,d13),
MK7=(d14,d15).
Order to
Figure RE-GSB00001820656100000621
The subkey is
Figure RE-GSB00001820656100000622
The subkey generation is as follows:
firstly, the method
Figure RE-GSB0000182065610000071
Figure RE-GSB0000182065610000072
Figure RE-GSB0000182065610000073
Figure RE-GSB0000182065610000074
Figure RE-GSB0000182065610000075
Figure RE-GSB0000182065610000076
Figure RE-GSB0000182065610000077
Figure RE-GSB0000182065610000078
Then, let W be 0, 1, 2i(i ═ 0, 1.., 23) is Ki+7The last 4 bits of (b) correspond to integers:
if WiWhen the value is equal to 0, then
Figure RE-GSB0000182065610000079
If Wi1, then
Figure RE-GSB00001820656100000710
If WiWhen 2, then
Figure RE-GSB00001820656100000711
If WiWhen being equal to 3, then
Figure RE-GSB00001820656100000712
If WiWhen the value is 4, then
Figure RE-GSB00001820656100000713
If WiWhen the value is 5, then
Figure RE-GSB00001820656100000714
If WiWhen the value is 6, then
Figure RE-GSB00001820656100000715
If WiWhen being equal to 7, then
Figure RE-GSB00001820656100000716
If WiWhen it is equal to 8, then
Figure RE-GSB00001820656100000717
If WiWhen the result is 9, then
Figure RE-GSB00001820656100000718
If WiWhen the value is 10, then
Figure RE-GSB00001820656100000719
If WiWhen it is equal to 11, then
Figure RE-GSB00001820656100000720
If WiWhen the value is 12, then
Figure RE-GSB00001820656100000721
If WiWhen it is 13, then
Figure RE-GSB00001820656100000722
If WiWhen the value is 14, then
Figure RE-GSB00001820656100000723
If Wi15, then
Figure RE-GSB00001820656100000724
Description of the drawings:
1) the T' transformation is the same as T in the round function of the encryption algorithm;
2)CKifor the fixed key, the value method is as follows:
let cki,jIs a fixed key CKiI.e., the j-th byte (i: 0, 1.., 23; j: 0, 1), i.e., the data of the first byte (i: 0, 1)
Figure RE-GSB00001820656100000725
Ck is theni,j=(4i+j)×7(mod 256)。
The key expansion method of the rear 128 bits of the encryption key is the same as that of the front 128 bits, and the round key expanded by the front 128 bits is used as the round key in the 1, 2,. multidrug-seen rounds 24, and the round key expanded by the rear 128 bits is used as the round key in the 25, 26,. multidrug-seen rounds 48.
(3) Packet length/key length 256/256
The encryption key is denoted as (MK)0,MK1,MK2,MK3,MK4,MK5,MK6,MK7)(
Figure RE-GSB00001820656100000726
(i= 0,1,2,3,4,5,6,7))。
If the encryption key is represented by bytes as (d)0,d1,...,d31) Then, then
MK0=(d0,d1,d2,d3),
MK1=(d4,d5,d6,d7),
MK2=(d8,d9,d10,d11),
MK3=(d12,d13,d14,d15),
MK4=(d16,d17,d18,d19),
MK5=(d20,d21,d22,d23),
MK6=(d24,d25,d26,d27),
MK7=(d28,d29,d30,d31).
Order to
Figure RE-GSB0000182065610000081
The subkey is
Figure RE-GSB0000182065610000082
The subkey generation is as follows: firstly, the method
Figure RE-GSB0000182065610000083
Figure RE-GSB0000182065610000084
Figure RE-GSB0000182065610000085
Figure RE-GSB0000182065610000086
Figure RE-GSB0000182065610000087
Figure RE-GSB0000182065610000088
Figure RE-GSB0000182065610000089
Figure RE-GSB00001820656100000810
Then, let W be 0, 1, 2i(i ═ 0, 1,. times.31) is Ki+7The last 4 bits of (b) correspond to integers:
if WiWhen the value is equal to 0, then
Figure RE-GSB00001820656100000811
If Wi1, then
Figure RE-GSB00001820656100000812
If WiWhen 2, then
Figure RE-GSB00001820656100000813
If WiWhen being equal to 3, then
Figure RE-GSB00001820656100000814
If WiWhen the value is 4, then
Figure RE-GSB00001820656100000815
If WiWhen the value is 5, then
Figure RE-GSB00001820656100000816
If WiWhen the value is 6, then
Figure RE-GSB00001820656100000817
If WiWhen being equal to 7, then
Figure RE-GSB00001820656100000818
If WiWhen it is equal to 8, then
Figure RE-GSB00001820656100000819
If WiWhen the result is 9, then
Figure RE-GSB00001820656100000820
If WiWhen the value is 10, then
Figure RE-GSB00001820656100000821
If WiWhen it is equal to 11, then
Figure RE-GSB00001820656100000822
If WiWhen the value is 12, then
Figure RE-GSB00001820656100000823
If WiWhen it is 13, then
Figure RE-GSB00001820656100000824
If WiWhen the value is 14, then
Figure RE-GSB00001820656100000825
If Wi15, then
Figure RE-GSB00001820656100000826
Description of the drawings:
1) the T' transformation is the same as T in the round function of the encryption algorithm;
2)CKifor the fixed key, the value method is as follows:
let cki,jAs a fixed key XKiI.e., the j-th byte (i 0, 1.., 31; j 0, 1), i.e., the data of the first byte (i)
Figure RE-GSB0000182065610000091
Ck is theni,j=(4i+j)×7(mod 256)。

Claims (1)

  1. A BWGCF block cipher algorithm implementation method is characterized by comprising the following steps: the BWGCF block cipher algorithm implementation method is composed of the following four algorithms:
    BWGCF algorithm control and selection algorithm
    Let the subkey be k0,k1,k2,k3,…,kL-1Then the BWGCF control selection algorithm is:
    W=ki0+2×ki1+4×ki2+8×ki3
    wherein k isi3,ki2,ki1,ki0Is a subkey kiThe last four bits.
    Tword function construction algorithm of BWGCF algorithm
    (1) Packet length/key length 128/128
    T is
    Figure FSA0000180830030000011
    The transformation of (2) is a fixed composite permutation independent of the key, and is composed of a nonlinear transformation layer and a linear transformation layer.
    1) Non-linear transformation tau
    The non-linear transform τ is made up of 2 parallel 8 x 8S-boxes, actually byte-instead transforms.
    Let the input be
    Figure FSA0000180830030000012
    Output is as
    Figure FSA0000180830030000013
    Then
    (b0,b1)=τ(A)=(sbox(a0),sbox(a1)).
    2) Linear transformation A
    The output of the nonlinear transformation τ is the input of the linear transformation a (satisfying that both the linear and differential branch numbers are 3). Let the input be
    Figure FSA0000180830030000014
    Output is as
    Figure FSA0000180830030000015
    Then
    Figure FSA0000180830030000016
    S-box production mode:
    S-Box affine equivalent to finite field GF (2)8) The multiplicative inverse function of (1).
    The reversible affine transformation pi over GF (2) is defined as follows:
    let input 8-bit variable a ═ a0,a1,…,a7) And outputting 8-bit variable b ═ pi (a) ═ b0,b1,…,b7) Then, then
    Figure FSA0000180830030000017
    Defining a finite field GF (2)8) The inverse of the multiplication in (1) is as follows:
    under GF (2)8) In the middle of using primitive polynomial
    g(x)=x8+x7+x6+x5+x4+x2+1,
    Mapping x to x-1And "00" maps to itself.
    The production mode of the S-box is as follows:
    input device
    Figure FSA0000180830030000018
    Output of
    Figure FSA0000180830030000019
    Then
    y=sbox(x)=π(f(π(x))).
    The S-box is as follows:
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0 d6 90 e9 fe cc e1 3d b7 16 b6 14 c2 28 fb 2c 05 1 2b 67 9a 76 2a be 04 c3 aa 44 13 26 49 86 06 99 2 9c 42 50 f4 91 ef 98 7a 33 54 0b 43 ed cf ac 62 3 e4 b3 1c a9 c9 08 e8 95 80 df 94 fa 75 8f 3f a6 4 47 07 a7 fc f3 73 17 ba 83 59 3c 19 e6 85 4f a8 5 68 6b 81 b2 71 64 da 8b f8 eb 0f 4b 70 56 9d 35 6 1e 24 0e 5e 63 58 d1 a2 25 22 7c 3b 01 21 78 87 7 d4 00 46 57 9f d3 27 52 4c 36 02 e7 a0 c4 c8 9e 8 ea bf 8a d2 40 c7 38 b5 a3 f7 f2 ce f9 61 15 a1 9 e0 ae 5d a4 9b 34 1a 55 ad 93 32 30 f5 8c b1 e3 a 1d f6 e2 2e 82 66 ca 60 c0 29 23 ab 0d 53 4e 6f b d5 db 37 45 de fd 8e 2f 03 ff 6a 72 6d 6c 5b 51 c 8d 1b af 92 bb dd bc 7f 11 d9 5c 41 1f 10 5a d8 d 0a c1 31 88 a5 cd 7b bd 2d 74 d0 12 b8 e5 b4 b0 e 89 69 97 4a 0c 96 77 7e 65 b9 f1 09 c5 6e c6 84 f 18 f0 7d ec 3a dc 4d 20 79 ee 5f 3e d7 cb 39 48
    (2) packet length/key length 128/256
    The T function of the packet length/key length of 128/256 is the same as the T function of the packet length/key length of 128/128.
    (3) Packet length/key length 256/256
    T is
    Figure FSA0000180830030000021
    The transformation of (2) is a fixed composite permutation independent of the key, and is composed of a nonlinear transformation layer and a linear transformation layer.
    1) Non-linear transformation tau
    The non-linear transform τ is made up of 2 parallel 16 x 16S-boxes, actually a two-byte substitution transform.
    Let the input be
    Figure FSA0000180830030000022
    Output is as
    Figure FSA0000180830030000023
    Then
    (b0,b1)=τ(A)=(sbox(a0),sbox(a1)).
    2) Linear transformation A
    The output of the nonlinear transformation τ is the input of the linear transformation a (satisfying that both the linear and differential branch numbers are 3). Let the input be
    Figure FSA0000180830030000024
    Output is as
    Figure FSA0000180830030000025
    Then
    Figure FSA0000180830030000026
    S-box production mode:
    defining a finite field GF (2)16) The inverse of the multiplication in (1) is as follows:
    under GF (2)16) In the middle of using primitive polynomial
    g(x)=x16+x5+x3+x+1,
    Mapping x to x-1And "00" maps to itself.
    BWGCF algorithm encryption algorithm
    (1) Packet length/key length 128/128
    The encryption algorithm for packet length/key length 128/128 is as follows:
    1) round key expansion is carried out on the 128-bit basic key to generate a sub-key k0,k1,…,k47
    2) Let 128 bits plaintext input as
    Figure FSA0000180830030000031
    The ciphertext is output as
    Figure FSA0000180830030000032
    Calculating W ═ ki0+2×ki1+4×ki2+8×ki3Wherein k isi3,ki2,ki1,ki0Is a subkey kiThe last four bits of (i ═ 0, 1, …, 47).
    If WiWhen the value is equal to 0, then
    Figure FSA0000180830030000033
    If Wi1, then
    Figure FSA0000180830030000034
    If WiWhen 2, then
    Figure FSA0000180830030000035
    If WiWhen being equal to 3, then
    Figure FSA0000180830030000036
    If WiWhen the value is 4, then
    Figure FSA0000180830030000037
    If WiWhen the value is 5, then
    Figure FSA0000180830030000038
    If WiWhen the value is 6, then
    Figure FSA0000180830030000039
    If WiWhen being equal to 7, then
    Figure FSA00001808300300000310
    If WiWhen it is equal to 8, then
    Figure FSA00001808300300000311
    If WiWhen the result is 9, then
    Figure FSA00001808300300000312
    If WiWhen the value is 10, then
    Figure FSA00001808300300000313
    If WiWhen it is equal to 11, then
    Figure FSA00001808300300000314
    If WiWhen the value is 12, then
    Figure FSA00001808300300000315
    If WiWhen it is 13, then
    Figure FSA00001808300300000316
    If WiWhen the value is 14, then
    Figure FSA00001808300300000317
    If Wi15, then
    Figure FSA00001808300300000318
    3) The state of the register is the ciphertext when the BWGCF algorithm moves 48 beats, namely
    (Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)=(X48,X49,X50,X51,X52,X53,X54,X55).
    (2) Packet length/key length 128/256
    The encryption algorithm for packet length/key length 128/256 is the same as the encryption algorithm for packet length/key length 128/128.
    (3) Packet length/key length 128/256
    The encryption algorithm for packet length/key length 256/256 is as follows:
    1) round key expansion is carried out on the 256-bit basic key to generate a sub-key k0,k1,…,k31
    2) Let 256 bits plaintext input be
    Figure FSA00001808300300000319
    The ciphertext is output as
    Figure FSA00001808300300000320
    Calculating W ═ ki0+2×ki1+4×ki2+8×ki3Wherein k isi3,ki2,ki1,ki0Is a subkey kiThe last four bits of (i ═ 0, 1, …, 31).
    If WiWhen the value is equal to 0, then
    Figure FSA00001808300300000321
    If Wi1, then
    Figure FSA00001808300300000322
    If WiWhen 2, then
    Figure FSA00001808300300000323
    If WiWhen being equal to 3, then
    Figure FSA00001808300300000324
    If WiWhen the value is 4, then
    Figure FSA00001808300300000325
    If WiWhen the value is 5, then
    Figure FSA00001808300300000326
    If WiWhen the value is 6, then
    Figure FSA0000180830030000041
    If WiWhen being equal to 7, then
    Figure FSA0000180830030000042
    If WiWhen it is equal to 8, then
    Figure FSA0000180830030000043
    If WiWhen the result is 9, then
    Figure FSA0000180830030000044
    If WiWhen the value is 10, then
    Figure FSA0000180830030000045
    If WiWhen it is equal to 11, then
    Figure FSA0000180830030000046
    If WiWhen the value is 12, then
    Figure FSA0000180830030000047
    If WiWhen it is 13, then
    Figure FSA0000180830030000048
    If WiWhen the value is 14, then
    Figure FSA0000180830030000049
    If Wi15, then
    Figure FSA00001808300300000410
    3) The state of the register is the ciphertext when the BWGCF algorithm moves 32 beats, namely
    (Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)=(X32,X33,X34,X35,X36,X37,X38,X39).
    (4) Decryption algorithm
    And (5) inverting the ciphertext to obtain the plaintext.
    BWGCF algorithm key expansion algorithm
    (1) Packet length/key length 128/128
    The encryption key is recorded as
    Figure FSA00001808300300000411
    Figure FSA00001808300300000412
    If the encryption key is represented by bytes as (d)0,d1,…,d15) Then, then
    MK0=(d0,d1),
    MK1=(d2,d3),
    MK2=(d4,d5),
    MK3=(d6,d7),
    MK4=(d8,d9),
    MK5=(d10,d11),
    MK6=(d12,d13),
    MK7=(d14,d15).
    Order to
    Figure FSA00001808300300000413
    The subkey is
    Figure FSA00001808300300000414
    The subkey generation is as follows: firstly, the method
    Figure FSA00001808300300000415
    Figure FSA00001808300300000416
    Figure FSA00001808300300000417
    Figure FSA00001808300300000418
    Figure FSA00001808300300000419
    Figure FSA00001808300300000420
    Figure FSA00001808300300000421
    Figure FSA00001808300300000422
    Then, for i equal to 0, 1, 2, …, 47, let Wi(i-0, 1, …, 47) is Ki+7The last 4 bits of (b) correspond to integers:
    if WiWhen the value is equal to 0, then
    Figure FSA0000180830030000051
    If Wi1, then
    Figure FSA0000180830030000052
    If WiWhen 2, then
    Figure FSA0000180830030000053
    If WiWhen being equal to 3, then
    Figure FSA0000180830030000054
    If WiWhen the value is 4, then
    Figure FSA0000180830030000055
    If WiWhen the value is 5, then
    Figure FSA0000180830030000056
    If WiWhen the value is 6, then
    Figure FSA0000180830030000057
    If WiWhen being equal to 7, then
    Figure FSA0000180830030000058
    If WiWhen it is equal to 8, then
    Figure FSA0000180830030000059
    If WiWhen the result is 9, then
    Figure FSA00001808300300000510
    If WiWhen the value is 10, then
    Figure FSA00001808300300000511
    If WiWhen it is equal to 11, then
    Figure FSA00001808300300000512
    If WiWhen the value is 12, then
    Figure FSA00001808300300000513
    If WiWhen it is 13, then
    Figure FSA00001808300300000514
    If WiWhen the value is 14, then
    Figure FSA00001808300300000515
    If Wi15, then
    Figure FSA00001808300300000516
    Description of the drawings:
    1) the T' transformation is the same as T in the round function of the encryption algorithm;
    2)CKifor the fixed key, the value method is as follows:
    let cki,jIs a fixed key CKiI.e., the jth byte (i-0, 1, …, 47; j-0, 1), i.e., the byte (i-0, 1, …, 47) of (1)
    Figure FSA00001808300300000517
    Ck is theni,j=(4i+j)×7(mod 256)。
    (2) Packet length/key length 128/256
    Encryption and decryption128 bits before the key are recorded as
    Figure FSA00001808300300000518
    Figure FSA00001808300300000519
    If the encryption key is represented by bytes as (d)0,d1,…,d15) Then, then
    MK0=(d0,d1),
    MK1=(d2,d3),
    MK2=(d4,d5),
    MK3=(d6,d7),
    MK4=(d8,d9),
    MK5=(d10,d11),
    MK6=(d12,d13),
    MK7=(d14,d15).
    Order to
    Figure FSA00001808300300000520
    The subkey is
    Figure FSA00001808300300000521
    The subkey generation is as follows:
    firstly, the method
    Figure FSA00001808300300000522
    Figure FSA00001808300300000523
    Figure FSA0000180830030000061
    Figure FSA0000180830030000062
    Figure FSA0000180830030000063
    Figure FSA0000180830030000064
    Figure FSA0000180830030000065
    Figure FSA0000180830030000066
    Then, let W be 0, 1, 2, …, 23 for ii(i-0, 1, …, 23) is Ki+7The last 4 bits of (b) correspond to integers:
    if WiWhen the value is equal to 0, then
    Figure FSA0000180830030000067
    If Wi1, then
    Figure FSA0000180830030000068
    If WiWhen 2, then
    Figure FSA0000180830030000069
    If WiWhen being equal to 3, then
    Figure FSA00001808300300000610
    If WiWhen the value is 4, then
    Figure FSA00001808300300000611
    If WiWhen the value is 5, then
    Figure FSA00001808300300000612
    If WiWhen the value is 6, then
    Figure FSA00001808300300000613
    If WiWhen being equal to 7, then
    Figure FSA00001808300300000614
    If WiWhen it is equal to 8, then
    Figure FSA00001808300300000615
    If WiWhen the result is 9, then
    Figure FSA00001808300300000616
    If WiWhen the value is 10, then
    Figure FSA00001808300300000617
    If WiWhen it is equal to 11, then
    Figure FSA00001808300300000618
    If WiWhen the value is 12, then
    Figure FSA00001808300300000619
    If WiWhen it is 13, then
    Figure FSA00001808300300000620
    If WiWhen the value is 14, then
    Figure FSA00001808300300000621
    If Wi15, then
    Figure FSA00001808300300000622
    Description of the drawings:
    1) the T' transformation is the same as T in the round function of the encryption algorithm;
    2)CKifor the fixed key, the value method is as follows:
    let cki,jIs a fixed key CKiI.e., the jth byte (i-0, 1, …, 23; j-0, 1), i.e., the byte (i-0, 1) of (1, …, 23)
    Figure FSA00001808300300000623
    Ck is theni,j=(4i+j)×7(mod 256)。
    The key expansion method of the rear 128 bits of the encryption key is the same as that of the front 128 bits, and the round key expanded by the front 128 bits is used as the round key in the 1, 2, … and 24 rounds, and the round key expanded by the rear 128 bits is used as the round key in the 25, 26, … and 48 rounds.
    (3) Packet length/key length 256/256
    The encryption key is recorded as
    Figure FSA00001808300300000624
    Figure FSA00001808300300000625
    If the encryption key is represented by bytes as (d)0,d1,…,d31) Then, then
    MK0=(d0,d1,d2,d3),
    MK1=(d4,d5,d6,d7),
    MK2=(d8,d9,d10,d11),
    MK3=(d12,d13,d14,d15),
    MK4=(d16,d17,d18,d19),
    MK5=(d20,d21,d22,d23),
    MK6=(d24,d25,d26,d27),
    MK7=(d28,d29,d30,d31).
    Order to
    Figure FSA0000180830030000071
    The subkey is
    Figure FSA0000180830030000072
    The subkey generation is as follows: firstly, the method
    Figure FSA0000180830030000073
    Figure FSA0000180830030000074
    Figure FSA0000180830030000075
    Figure FSA0000180830030000076
    Figure FSA0000180830030000077
    Figure FSA0000180830030000078
    Figure FSA0000180830030000079
    Figure FSA00001808300300000710
    Then, for i equal to 0, 1, 2, …, 31, let Wi(i-0, 1, …, 31) is Ki+7The last 4 bits of (b) correspond to integers:
    if WiWhen the value is equal to 0, then
    Figure FSA00001808300300000711
    If Wi1, then
    Figure FSA00001808300300000712
    If WiWhen 2, then
    Figure FSA00001808300300000713
    If WiWhen being equal to 3, then
    Figure FSA00001808300300000714
    If WiWhen the value is 4, then
    Figure FSA00001808300300000715
    If WiWhen the value is 5, then
    Figure FSA00001808300300000716
    If WiWhen the value is 6, then
    Figure FSA00001808300300000717
    If WiWhen being equal to 7, then
    Figure FSA00001808300300000718
    If WiWhen it is equal to 8, then
    Figure FSA00001808300300000719
    If WiWhen the result is 9, then
    Figure FSA00001808300300000720
    If WiWhen the value is 10, then
    Figure FSA00001808300300000721
    If WiWhen it is equal to 11, then
    Figure FSA00001808300300000722
    If WiWhen the value is 12, then
    Figure FSA00001808300300000723
    If WiWhen it is 13, then
    Figure FSA00001808300300000724
    If WiWhen the value is 14, then
    Figure FSA00001808300300000725
    If Wi15, then
    Figure FSA00001808300300000726
    Description of the drawings:
    1) the T' transformation is the same as T in the round function of the encryption algorithm;
    2)CKifor the fixed key, the value method is as follows:
    let cki,jIs a fixed key CKiThe jth byte of (i ═ 0, 1, …, 31; j ═ 0, 1)I.e. by
    Figure FSA00001808300300000727
    Ck is theni,j=(4i+j)×7(mod 256)。
CN201910225576.0A 2019-03-25 2019-03-25 BWGCF block cipher algorithm realizing method Active CN111740816B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910225576.0A CN111740816B (en) 2019-03-25 2019-03-25 BWGCF block cipher algorithm realizing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910225576.0A CN111740816B (en) 2019-03-25 2019-03-25 BWGCF block cipher algorithm realizing method

Publications (2)

Publication Number Publication Date
CN111740816A true CN111740816A (en) 2020-10-02
CN111740816B CN111740816B (en) 2023-03-31

Family

ID=72645837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910225576.0A Active CN111740816B (en) 2019-03-25 2019-03-25 BWGCF block cipher algorithm realizing method

Country Status (1)

Country Link
CN (1) CN111740816B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1993922A (en) * 2004-07-30 2007-07-04 英特尔公司 Stream cipher combining system and method
CN101826959A (en) * 2010-05-14 2010-09-08 中国科学院软件研究所 Byte-oriented key stream generation method and encryption method
CN101938351A (en) * 2010-09-16 2011-01-05 北京航空航天大学 Key expanding method for encrypting block cipher
US20110116627A1 (en) * 2009-11-15 2011-05-19 Ante Deng Fast Key-changing Hardware Apparatus for AES Block Cipher
CN107623568A (en) * 2016-07-15 2018-01-23 青岛博文广成信息安全技术有限公司 SM4 whitepack algorithms based on the S boxes for relying on key

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1993922A (en) * 2004-07-30 2007-07-04 英特尔公司 Stream cipher combining system and method
US20110116627A1 (en) * 2009-11-15 2011-05-19 Ante Deng Fast Key-changing Hardware Apparatus for AES Block Cipher
CN101826959A (en) * 2010-05-14 2010-09-08 中国科学院软件研究所 Byte-oriented key stream generation method and encryption method
CN101938351A (en) * 2010-09-16 2011-01-05 北京航空航天大学 Key expanding method for encrypting block cipher
CN107623568A (en) * 2016-07-15 2018-01-23 青岛博文广成信息安全技术有限公司 SM4 whitepack algorithms based on the S boxes for relying on key

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨笑等: "BOMM算法的密码学性质", 《软件学报》 *

Also Published As

Publication number Publication date
CN111740816B (en) 2023-03-31

Similar Documents

Publication Publication Date Title
US5745577A (en) Symmetric cryptographic system for data encryption
Kwon et al. New block cipher: ARIA
Liu et al. Analysis of the SMS4 block cipher
Lim CRYPTON: A new 128-bit block cipher
Diffie et al. SMS4 encryption algorithm for wireless networks
US6804355B1 (en) Block cipher for small selectable block sizes
Verma et al. Performance analysis of RC6, Twofish and Rijndael block cipher algorithms
Mendel et al. Improved cryptanalysis of the reduced Grøstl compression function, ECHO permutation and AES block cipher
Stallings The advanced encryption standard
Nakahara Jr et al. A New Involutory MDS Matrix for the AES.
JP2004502965A (en) Replacement box for symmetric key cryptography
Youssef et al. A new class of substitution-permutation networks
Gnatyuk et al. High-Performance Reliable Block Encryption Algorithms Secured against Linear and Differential Cryptanalytic Attacks.
Shivkumar et al. Performance Comparison of Advanced Encryption Standard (AES) and AES key dependent S-box-Simulation using MATLAB
Niemiec et al. A new symmetric block cipher based on key-dependent S-boxes
CN101938351A (en) Key expanding method for encrypting block cipher
CN111245598A (en) Method for realizing lightweight AEROGEL block cipher
Gehlot et al. Implementation of Modified Twofish Algorithm using 128 and 192-bit keys on VHDL
Abd-ElGhafar et al. Generation of AES key dependent S-boxes using RC4 algorithm
Stoianov One approach of using key-dependent S-BOXes in AES
Jingmei et al. One AES S-box to increase complexity and its cryptanalysis
CN111740816B (en) BWGCF block cipher algorithm realizing method
CN116707877A (en) Data encryption method and system based on improved AES algorithm
CN110532763B (en) Password construction method and system based on high-order orthomorphism replacement
Biyashev et al. Development and analysis of the encryption algorithm in nonpositional polynomial notations

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