Idea Plus decryption

Source: Internet
Author: User
Tags rounds

A Introduction to Idea algorithm

IDEA (International Data encryption Alogrithm) was presented by Xuejialai and James L.massey of the Federal Institute of Technology in Zurich, Switzerland, in 1991. IDEA uses a 128-bit key, the entire algorithm and Des similar, but also divides the plaintext into a 64-specific data grouping, and then after several iterations and a transformation, to obtain 64 bits of ciphertext.

idea is to map two 16-bit values to a 16-bit value, which are:

The half-plus operation, the "XOR" operation, is denoted by the symbol "⊙". The so-called half-plus operation, which is only added when binary operation is performed, does not carry.

The addition of modulo 216 (that is, mod 65536), denoted by "+".

Modulo 216+1 multiplication is denoted by the symbol "⊙".

In fact, ⊙ is the multiplication of the number of two inputs, and then the results by the modulo 216+1 operation. For such operations it should be noted that any binary data n bits that participate in the operation, if all are 0, are represented with n+1 bit data, and the highest level is 1, and the remainder is all 0.

To understand the above three operations, we use 2-bit numbers to represent the above three relationships, as shown in table 2-3-1.


Table 2-3-1 idea three operations relationship



X

Y

Xy

X⊙y

X⊕y

Decimal

Binary

Decimal

Binary

Decimal

Binary

Decimal

Binary

Decimal

Binary

0

00

0

00

0

00

1

01

0

00

0

00

1

01

1

01

0

00

1

01

0

00

2

10

2

10

3

11

2

10

0

00

3

11

3

11

2

10

3

11

1

01

0

00

1

01

0

00

1

01

1

01

1

01

2

10

1

01

0

00

1

01

2

10

3

11

2

10

3

11

1

01

3

11

0

00

3

11

2

10

2

10

0

00

2

10

3

11

2

10

2

10

1

01

3

11

2

10

3

11

2

10

2

10

0

00

0

00

0

00

2

10

3

11

1

01

1

01

1

01

3

11

0

00

3

11

2

10

3

11

3

11

1

01

0

00

3

11

2

10

3

11

2

10

1

01

1

01

1

01

3

11

3

11

2

10

0

00

0

00


Two IDEA algorithm Encryption process

1. Idea Iterative Process

The idea encryption algorithm uses 8 iterations, 2-3-1 shows:





Figure 2-3-1 8 iterations


The data generated by the 64-bit key is divided into 8 sub-blocks, each of which is 16 bits. Each iteration process is shown in 2-3-2:






Figure 2-3-2 Single Iteration process


In the "description" figure, the ⊙ represents the XOR operation; represents the addition operation of modulo 216; ⊙ represents the multiplication operation of the modulus 216+1.

X1,X2,X3 and X4 as input for the first iteration, each iteration of the round is an XOR operation between 4 sub-blocks and 16-bit sub-keys, modulo 216 is a multiplication of addition and modulo (216+1).

The iteration steps are as follows:

(1) X1 and the first sub-key block do the multiplication operation.

(2) X2 and the second sub-key block do the addition operation.

(3) X3 and the third sub-key block do the addition operation.

(4) X4 and the fourth sub-key block to do the multiplication operation.

(5) The results of (1) and (3) are different or calculated.

(6) The results of (2) and (4) are different or calculated.

The result of (7) (5) and the fifth sub-key block are multiplied.

(8) The results of (6) and (7) do addition operations.

The result of (9) (8) is multiplied with the sixth sub-key block.

(10) The results of (7) and (9) do addition operations.

(11) The results of (1) and (9) are different or calculated.

(12) The results of (3) and (9) are different or calculated.

(13) The results of (2) and (10) are different or calculated.

(14) The results of (4) and (10) are different or calculated.

Each round completes the above 14 operations, a total of 8 rounds, and then the final output transformation, 2-3-3 is shown. After 8-round iterative operation, the w81,w82,w83,w84 and z48,z49,z50,z51 operations are y1,y2,y3 and Y4 respectively. The method is as follows:






Figure 2-3-3 Output transformation after 8-wheel iterative transformation


2. Idea Key generation process

As can be seen in Figure 2-3-3, there are 52 sub-key blocks involved in the encryption process, each block is 16 bits long. These 52 key blocks are generated by a 128-bit key, and we record these 52 key blocks as z0,z1......,z51. The initial 8 subkeys are z0,z1,......,z7 directly from the user input, Z0 is the first 16 bits of the user's input key, Z1 is the second 16-bit of the user's input key, and Z7 is the last 16 bits of the user's input key. This way the key from Z0 to Z7 has a total length of 128 bits.

Idea each iteration uses 6 sub-keys, each with 16 bits, which means that only 96 bits of the key are used in a round of iterations. The initial 6 consecutive subkeys (Z0 to Z5) are used directly for the first iteration, and then the 128-bit key is looped to the left 25 bits, then the first 96 bits of the key are taken as the next 6 subkeys of the second round. And so on until the 8-round iteration is complete.

3. The relationship between idea decryption algorithm and its encryption

Idea decryption processing and its cryptographic processing is basically the same, just decryption processing input is ciphertext, the choice of key is not the same, but there is a certain connection. Its relationship to the encryption key is as follows.

The first four keys of the decryption process are the same as the first round of the encryption process (10-I), and the last permutation as the 9th round. The decryption process of the 1th and 4th round is the corresponding cryptographic processing process 1th and 4th round modulo (216+1) multiplication operation, the decryption process of the 2nd wheel and the 3rd wheel corresponding to the encryption process of the 3rd wheel and the 2nd wheel modulo 216 addition operation.

In the first 8-round operation, the last two sub-key blocks of the decrypted first-round are equal to the last two sub-key blocks of the 9-i wheel in the encryption process. Each round of encryption and decryption of the child key relationship is shown in table 2-3-2.


Table 2-3-2 Encryption and decryption of child key relationships


Plus decryption rounds

Encryption key for each round

Bits corresponding to the original key

First round

Z0z1z2z3z4z5

Z48-1-z49-z50z51-1z46z47

Second round

Z6z7z8z9z10z11

Z42-1-z44-z43z45-1z40z41

Third round

Z12z13z14z15z16z17

Z36-1-z38-z37z39-1z34z35

Fourth round

Z28z19z20z21z22z23

Z30-1-z32-z31z33-1z28z29

Fifth round

Z34z25z26z27z28z29

Z24-1-z26-z25z27-1z22z23

Sixth round

Z30z31z32z33z34z35

Z18-1z20-z19z21-1z18z17

Seventh round

Z46z37z38z39z40z41

Z12-1z14-z13z15-1z10z11

Eighth round

Z42z43z44z45z46z47

Z6-1-z8-z7z9-1z4z5

The final permutation

Z48z49z50z51

Z0-1-z1-z2z3-1



The relationship between the above ZJ and Zj-1 and-zj and ZJ is as follows:


This article is from the "11527662" blog, please be sure to keep this source http://11537662.blog.51cto.com/11527662/1881623

Idea Plus decryption

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.