International Core Journal of Engineering 2020-26 | Page 187
multiply the value of each level of the register by the current
state of the tap coefficient and then perform modulo-2
addition processing to obtain the final feedback result. It will
enter the first stage as input, and at the same time, the current
tap coefficient state is treated as a binary integer, which is
added to 2 to obtain a new tap coefficient state, and then it
will participate in the new feedback operation. So, at the
beginning, we set the initial value of each stage of the
), and the initial tap
feedback shift register to ( , ,…,
) starts to send the shift
coefficient state is ( , , …,
signal continuously. At this time, the register will output a
,
,… , which is called the key stream,
sequence
… .
remember Z=
Fig. 4. Initialization function
The function of this function is to initialize the key and
the encryption coefficient, input n bytes from the port and
assign them to the initial state Z, and then assign it to the
initial tap coefficient state C in reverse order. Note that the
lowest bit of C is to ensure Is 1, so that no 0 state stream will
be generated. Finally, the initial state is stored in a two-
dimensional array, the first behavior is the initial state of the
register, and the second behavior is the initial state of the tap
coefficient, which facilitates subsequent calculation.
Fig. 3. Schematic diagram of binary tap variable feedback shift register
B. The Nature of Binary Tap Variable Sequences
By correlation, we obtain the binary tap variable sequence
with the following properties:
Product exclusive OR function zAndC()
Property 4-1: Assuming k is an arbitrary positive integer,
the state of any two tap coefficients of the binary tap variable
feedback shift register conforms to the following equation:
= +2*k
(4)
Corollary 4-1: Let m be a positive integer, and when
k=m2 , there is
= (mod 2).
Property 4-2: If the key stream has a key state of 0, the
key stream must be a 0 state stream, meaning no other state. Fig. 5. Product exclusive OR function
Property 4-3: If there is a tap coefficient state
=( , , , ⋯ ,
), =( , , , ⋯ ,
), k is any
positive integer, and = holds. This function implements the product of Z, C on GF(2)
and modulo 2 addition. Finally, the operation result is fed
back to the first-level storage unit of the register.
Bit shift function zMove()
Property 4-4: If there are preconditions
≠ 0 and
≠0, then in this case the key stream Z will not have a 0
state stream.
Property 4-5: The key stream Z must be the final periodic
sequence.
Property 4-6: If the key stream Z is known to be a periodic
=( , ,…,
) satisfies
sequence, and its initial state
≠0, then the period of Z is at least 2 .
V. I MPLEMENTATION O F B INARY T AP V ARIABLE F EEDBACK
S HIFT R EGISTER
We use java to implement, set the class centerModule,
which contains the data and functions such as key length, key
initialization function, key stream generator, etc., and
encapsulate the above functions.
Fig. 6. Bit shift function
This function can be used to simulate the shift of the key
bits in the feedback shift register. The last bit Z[n-1] of the Z
state at this time is removed as the output shift key bit, and
A. Function Introduction
Key state initialization function initZC()
165