|
Algorithm 1 The proposed chosen-plaintext attack |
-
Output:
The plaintext P of C
-
Input:
The ciphertext C of size H × D
-
1:
// step1: construct an all-zero matrix and obtain the equivalent key T of diffusion stage
-
2:
= zeros;
-
3:
= encrypt;
-
4:
;
-
5:
// step2: initialize matrices and get the corresponding ciphertexts
-
6:
for to do
-
7:
= JolfaeiAlgorithmGeneration(i);
-
8:
= encrypt;
-
9:
end for
-
10:
// step3: obtain middle results with the diffusion matrix T and the ciphertexts which are obtained in the step2
-
11:
for to do
-
12:
inverseDiffusionAttack;
-
13:
end for
-
14:
// step4: obtain the equivalent permutation matrix by the input plaintexts and the middle results
-
15:
for to do
-
16:
JolfaeiAlgorithmAdd;
-
17:
end for
-
18:
= JolfaeiAlgorithm();
-
19:
// step5: recover the the plaintext of the target ciphertext with the equivalent key stream elements which are obtained in previous steps
-
20:
= inverseDiffusionAttack;
-
21:
P = inversePermute();
|