Cryptography Reference
In-Depth Information
t := map(bytestohexstring, [ListTools:-LengthSplit(t, 16)]);
printf("%s\n", "Plaintext blocks:")
end if;
for i to nops(t) do
printf("%s\n", t[i])
end do;
printf("\n")
end proc:
Example 4.6 We compute the ciphertext blocks corresponding to Example F.4.3
(OFB-AES192.Encrypt) in [68]. The key, IV and plaintext in this example are:
> k192 := "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b":
IV := "000102030405060708090a0b0c0d0e0f":
pl := "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a\
35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710":
The corresponding ciphertext blocks, which may be compared to those in [68],
are then the following:
> ModesTest(k192, pl, OFB, IV);
Ciphertext blocks:
cdc80d6fddf18cab34c25909c99a4174
fcc28b8d4c63837c09e81700c1100401
8d9a9aeac0f6596f559c6d4daf59a5f2
6d9f200857ca6c3e9cac524bd9acc92a
Now, the decryption test with the IV plus the ciphertext obtained above recovers
the plaintext blocks of pl :
> ModesTest(k192, "000102030405060708090a0b0c0d0e0fcdc80d6fddf18cab34c25909c99a417\
4fcc28b8d4c63837c09e81700c11004018d9a9aeac0f6596f559c6d4daf59a5f26d9f200857ca6c3\
e9cac524bd9acc92a", OFB);
Plaintext blocks:
6bc1bee22e409f96e93d7e117393172a
ae2d8a571e03ac9c9eb76fac45af8e51
30c81c46a35ce411e5fbc1191a0a52ef
f69f2445df4f9b17ad2b417be66c3710
Example 4.7 We compute the ciphertext blocks corresponding to Example F.5.5
(CTR-AES256.Encrypt) in [68]. The plaintext is the same as in the preceding exam-
ple; the key and the initial counter are given below, and the ciphertext blocks are
computed:
> k256 := "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4":
initcounter := "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff":
ModesTest(k256, pl, CTR, initcounter);
Ciphertext blocks:
601ec313775789a5b7a7f504bbf3d228
f443e3ca4d62b59aca84e990cacaf5c5
2b0930daa23de94ce87017ba2d84988d
dfc9c58db67aada613c2dd08457941a6
The decryption test corresponding to the ciphertext just obtained produces the
plaintext blocks of Example F.5.5 (CTR-AES256.Decrypt) as follows:
> ModesTest(k256, "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff601ec313775789a5b7a7f504bbf3d22\
8f443e3ca4d62b59aca84e990cacaf5c52b0930daa23de94ce87017ba2d84988ddfc9c58db67aada\
613c2dd08457941a6", CTR);
Plaintext blocks:
6bc1bee22e409f96e93d7e117393172a
ae2d8a571e03ac9c9eb76fac45af8e51
30c81c46a35ce411e5fbc1191a0a52ef
f69f2445df4f9b17ad2b417be66c3710
Search WWH ::




Custom Search