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
6
0x4
8
0x7
F
0xB
6
0xF
4
0xB
2
0x8
0
0x9
6
0x
D
0x3
2
0x0
3
0x1
D
0xA
3
0x6
8
0x0
2
0xD
8
0xF
6
0x7
2
0x3
0
0x4
0
0xF
F
0x7
4
0xF
C
0x3
C
0x8
D
0x
E
0x5
F
0xB
0
0x4
A
0xD
E
0xD
D
0x0
5
0xD
B
0xA
8
0xD
6
0xA
0
0x6
2
0xF
0
0x8
2
0xC
A
0x9
2
0xC
2
0x
F
0x5
1
0x0
6
0x0
A
0x6
A
0x3
8
0x8
E
0x4
D
0xC
B
0xD
1
0x5
C
0xC
9
0xE
0
0x4
6
0xD
C
0x7
5
0x0
F
48
Consider encryption process of encryption algorithm AES–IDEA16–2. First,
512–bit block of plaintext
X
is partitioned into 32–bit subblocks
0
0
X
,
1
0
X
, …,
1 5
0
X
and
the following steps are performed:
1.
subblocks
0
0
X
,
1
0
X
, …,
1 5
0
X
are summed to XOR with the
corresponding round keys
16
18
n
K
,
17
18
n
K
, ...,
31
18
n
K
:
i
n
i
i
K
X
X
16
18
0
0
,
15
...
0
i
.
2.
subblocks
0
0
X
,
1
0
X
, …,
1 5
0
X
multiplied and summarized to the same
round keys
)
1
(
1 8
i
K
,
1
)
1
(
18
i
K
, ...,
15
)
1
(
18
i
K
and calculated
0
T
,
1
T
, ...,
1 5
T
as follows
)
(
)
(
8
)
1
(
18
8
1
)
1
(
18
0
1
0
i
i
i
i
K
X
K
X
T
,
)
(
)
(
9
)
1
(
18
9
1
1
)
1
(
18
1
1
1
i
i
i
i
K
X
K
X
T
,
)
(
)
(
10
)
1
(
18
10
1
2
)
1
(
18
2
1
2
i
i
i
i
K
X
K
X
T
,
)
(
)
(
11
)
1
(
18
11
1
3
)
1
(
18
3
1
3
i
i
i
i
K
X
K
X
T
,
)
(
)
(
12
)
1
(
18
12
1
4
)
1
(
18
4
1
4
i
i
i
i
K
X
K
X
T
,
)
(
)
(
13
)
1
(
18
13
1
5
)
1
(
18
5
1
5
i
i
i
i
K
X
K
X
T
,
)
(
)
(
14
)
1
(
18
14
1
6
)
1
(
18
6
1
6
i
i
i
i
K
X
K
X
T
,
)
(
)
(
15
)
1
(
18
15
1
7
)
1
(
18
7
1
7
i
i
i
i
K
X
K
X
T
,
1
i
.
3.
subblocks
0
T
,
1
T
, ...,
1 5
T
written in two arrays State and performed
SubBytes(), ShiftRows(), MixColumns(), AddRoundKey() transformation.
After the transformation 32 bit subblocks
0
Y
,
1
Y
, ...,
7
Y
is obtained
4.
subblocks
0
Y
,
1
Y
, ...,
7
Y
are summed to XOR with the
corresponding subblocks
j
i
X
1
i.e.
j
j
i
j
i
Y
X
X
7
1
1
,
j
j
i
j
i
Y
X
X
7
8
1
8
1
,
7
...
0
j
,
1
i
.
5.
at the end of round except subblocks
0
i
X
and
1 6
1
i
X
all subblocks will
be swapped
15
1
j
i
j
i
X
X
,
14
...
1
j
,
1
i
.
6.
repeating steps 2–5 n times, i.e.,
n
i
...
2
, the 32bit subblocks
0
n
X
,
1
n
X
, …,
3 1
n
X
is obtained
7.
in the output transformation round keys
n
K
18
,
1
18
n
K
, ...,
15
18
n
K
are
multiplied and summed with the corresponding subblocks
n
n
n
K
X
X
18
0
0
1
,
1
18
14
1
1
n
n
n
K
X
X
,
2
18
13
2
1
n
n
n
K
X
X
,
3
18
12
3
1
n
n
n
K
X
X
,
4
18
11
4
1
n
n
n
K
X
X
,
5
18
10
5
1
n
n
n
K
X
X
,
6
18
9
6
1
n
n
n
K
X
X
,
7
18
8
7
1
n
n
n
K
X
X
,
8
18
7
8
1
n
n
n
K
X
X
,
9
18
6
9
1
n
n
n
K
X
X
,
10
18
5
10
1
n
n
n
K
X
X
,
11
18
4
11
1
n
n
n
K
X
X
,
12
18
3
12
1
n
n
n
K
X
X
,
13
18
2
13
1
n
n
n
K
X
X
,
14
18
1
14
1
n
n
n
K
X
X
,
15
18
15
15
1
n
n
n
K
X
X
.
49
8.
subblocks
0
1
n
X
,
1
1
n
X
, …,
1 5
1
n
X
are summed to XOR with the
corresponding round keys
32
18
n
K
,
33
18
n
K
, ...,
47
18
n
K
:
j
n
j
n
j
n
K
X
X
32
18
1
1
,
15
...
0
j
. As
ciphertext plaintext
X
are accepted combining 32bit sub–blocks
15
1
1
1
0
1
| |
...
| |
| |
n
n
n
X
X
X
.
Key generation encryption algorithm AES–IDEA16–2
In the n–round encryption algorithm AES–IDEA16–2 each round are applied 16
round keys length of 32 bits, two key length of 128 bits and in output transformation
16 round keys length of 32 bits. Besides, before the first round and after output
transformation applied 16 round keys length of 32 bits. Total number of 32–bit round
keys equal to 16n+48 and 128–bit round key equal to 2n. If 128–bit round keys
convert to four 32–bit key, the total number of 32 bit keys equal to 24n+48. When
encryption in Figure 5 instead
i
K
used encryption round keys
c
i
K
, when decryption
decryption round keys
d
i
K
.
When generating round key like encryption algorithm AES are used array
Rcon: Rcon=[0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010,
0x00000020, 0x00000040, 0x00000080, 0x00000100, 0x00000200, 0x00000400,
0x00000800, 0x00001000, 0x00002000, 0x00004000, 0x00008000, 0x00010000,
0x00020000, 0x00040000, 0x00080000, 0x00100000, 0x00200000, 0x00400000,
0x00800000, 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,
0x20000000, 0x40000000, 0x80000000].
The key of encryption algorithm
K
length
l
(
1024
256
l
) bit is divided into 32–
bit round keys
'
0
c
K
,
'
1
c
K
,...,
'
1
c
Lenght
K
,
32
/
l
Lenght
, здесь
}
,...,
,
{
1
1
0
l
k
k
k
K
,
}
,...,
,
{
31
1
0
'
0
k
k
k
K
c
,
}
,...,
,
{
63
33
32
'
1
k
k
k
K
c
,...,
}
,...,
,
{
1
31
32
'
1
l
l
l
c
Lenght
k
k
k
K
and
'
1
'
1
'
0
||
...
||
||
c
Lenght
c
c
K
K
K
K
. Then calculated
'
1
'
1
'
0
...
c
Lenght
c
c
L
K
K
K
K
. If
0
L
K
then as
L
K
selected 0xC5C31537, i.е.
0xC5C31537
L
K
.
When generating a round keys
'
c
i
K
,
47
24
...
n
Lenght
i
used SubBytes32() and
RotWord32() transformation, here SubBytes32()–transformation 32–bit subblock in
the S–block, i.e.
))
(
(
||
))
(
(
||
))
(
(
||
))
(
(
)
(
32
1
1
0
0
1
1
0
0
X
sb
S
X
sb
S
X
sb
S
X
sb
S
X
SubBytes
, RotWord32() –
50
cyclic shift 32–bit subblock left by 1 bit. Here
0
S
and
1
S
– the S–boxes, given in the
table 1 and 2. If the conditions
1
3
mod
i
, then round keys calculated as
L
c
Lenght
i
c
Lenght
i
c
i
K
i
Rcon
K
RotWord
SubBytes
K
SubBytes
K
]
32
mod
[
))
(
32
(
32
)
(
32
'
'
1
'
,
otherwise
L
c
Lenght
i
c
Lenght
i
c
i
K
K
SubBytes
K
SubBytes
K
)
(
32
)
(
32
'
1
'
'
. After every generation of round keys
value
L
K
rotated to the left by 1 bit.
Decryption round keys are computed based on encryption round keys and
decryption keys output transformation associated with encryption keys as follows:
)
,
)
(
,
,
)
(
,
,
)
(
,
,
)
(
,
)
(
,
,
)
(
,
,
)
(
,
,
)
(
,
(
)
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
(
'
15
1
'
14
'
13
1
'
12
'
11
1
'
10
'
9
1
'
8
1
'
7
'
6
1
'
5
'
4
1
'
3
'
2
1
'
1
'
0
'
15
24
'
14
24
'
13
24
'
12
24
'
11
24
'
10
24
'
9
24
'
8
24
'
7
24
'
6
24
'
5
24
'
4
24
'
3
24
'
2
24
'
1
24
'
24
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
d
n
d
n
d
n
d
n
d
n
d
n
d
n
d
n
d
n
d
n
d
n
d
n
d
n
d
n
d
n
d
n
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
In the same manner, decryption keys second, third, and n–round associated with
the encryption keys following:
n
i
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
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
1
'
7
24
'
6
24
1
'
5
24
'
4
24
1
'
3
24
'
2
24
1
'
1
24
'
24
'
17
'
16
'
15
'
14
'
13
'
12
'
11
'
10
'
9
'
8
'
7
'
6
'
5
'
4
'
3
'
2
'
1
'
0
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
c
n
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
Decryption round key, applied to the first round and after output transformation
associated with encryption keys as follows:
'
32
24
'
16
24
c
j
n
d
j
n
K
K
,
'
16
24
'
32
24
c
j
n
d
j
n
K
K
,
15
...
0
j
Encryption round keys
c
i
K
associated with the keys
'
c
i
K
are as follows:
'
24
18
c
j
i
c
j
i
K
K
,
15
...
0
j
,
'
19
24
'
18
24
'
17
24
'
16
24
16
18
| |
| |
| |
c
i
c
i
c
i
c
i
c
i
K
K
K
K
K
,
'
23
24
'
22
24
'
21
24
'
20
24
17
18
| |
| |
| |
c
i
c
i
c
i
c
i
c
i
K
K
K
K
K
. In the same
manner, decryption round keys
d
i
K
associated with the keys
'
d
i
K
as follows:
'
24
18
d
j
i
d
j
i
K
K
,
15
...
0
j
,
'
19
24
'
18
24
'
17
24
'
16
24
16
18
| |
| |
| |
d
i
d
i
d
i
d
i
d
i
K
K
K
K
K
,
'
23
24
'
22
24
'
21
24
'
20
24
17
18
| |
| |
| |
d
i
d
i
d
i
d
i
d
i
K
K
K
K
K
.
Достарыңызбен бөлісу: |