Current location - Training Enrollment Network - Mathematics courses - What is the encryption mechanism of idea?
What is the encryption mechanism of idea?
The IDEA encryption standard is used by PGP (quite good privacy) systems. Public key encryption uses two different keys, so it is an asymmetric encryption system. One of its keys is public, and the basic functions of the system can also be accessed by people with public keys, which can be stored in the system directory or unencrypted e-mail. Its other key is dedicated to encrypt information, but the public key can decrypt information, and it can also decrypt information encrypted by the public key. On the premise of providing the same security, the system with private key encryption is faster.

RC5 block cipher algorithm was invented by Professor Ronald L. Rivest of Massachusetts Institute of Technology 1994, and analyzed by RSA Laboratory. It is a block cipher algorithm with variable parameters. These three variable parameters are: block size, key size and encryption round. Three operations are used in this algorithm: XOR, addition and loop.

RC5 is a relatively new algorithm. Rivest designed a special implementation of RC5, so RC5 algorithm has a word-oriented structure: RC5-w/r/b, where W is the word length, and the value can be 16, 32 or 64. The block length of plaintext and ciphertext with different word lengths is 2w bits, where r is the number of encryption rounds and b is the length of key bytes. Because RC5 is a cryptographic algorithm with variable packet length, for the convenience of explanation, this paper mainly focuses on the 64-bit packet w=32, and the encryption and decryption process of RC5 is described in detail below:

1. Create a key group. RC5 algorithm uses 2r+2 key-related 32-bit words: when encrypting, where R represents the number of rounds of encryption. The process of creating this key group is very complicated, but it is straightforward. First, copy the key bytes into the array L of 32-bit words (note whether the processor is in small-endian order or big-endian order), and the last word can be filled with zeros as needed. Then, the array s is initialized by using the linear congruence generator modulo 2:

For i= 1 to 2(r+ 1)- 1: (it should be a module, and this paper assumes w=32).

Where P=0xb7e 1 Q=0x9e37 for the 32-bit grouping RC5 of the 16-bit word.

For RC5 of 64-bit grouping of 32-bit words, p = 0xb7e15163q = 0x9e3779b9.

For 64-bit words and 128-bit packets, p = 0xb7151628ad2a6bq = 0x9e3779b97f47c15.

Finally, l and s are mixed, and the mixing process is as follows:

i=j=0

A=B=0

Process for 3n times (where n is the maximum of 2(r+ 1) and c, where c represents the number of keywords entered).

2. Encryption: plaintext is encrypted after the key group is created. When encrypting, the plaintext packet is divided into two 32-bit words, A and B (assuming that the byte order of the processor is little- endian, w=32, the first plaintext byte enters the lowest byte of A, the fourth plaintext byte enters the highest byte of A, the fifth plaintext byte enters the lowest byte of B, and so on). & lt& lt means that the loop moves to the left, and the addition operation is a modular operation (intrinsic modulus, let w=32 in this paper). The output ciphertext is the contents of registers a and b.

3. Decryption processing. Decryption is also easy. Ciphertext grouping is divided into two words, A and B (the storage method is the same as encryption), which is consistent with >:>& gt is cyclic right shift, and subtraction operation is also modular operation (let w=32 in this paper).

IDEA algorithm is considered as the best and safest block cipher algorithm today!