Show two types of forgery attacks for authenticated encryption scheme CBC-XOR.
Given a pseudorandom permutation F
Gen: k <- {0, 1}^n
Enc: On input a message m = B_0 || B_1 || ... || B_l and a key k,
uniformly generate an IV <- {0, 1}^m
1. Compute B_{l+1} = B_0 ^ B_1 ^ ... ^ B_l
2. Do CBC encryption on m || B_{l+1} using k and IV
- Output ciphertext c := IV || c_0 || c_1 || ... || c_l || c_{l+1}
Dec: On input a ciphertext c = IV || c_0 || c_1 || ... || c_l || c_{l+1} and a key k
1. Do CBC decryption on c_0 || c_1 || ... || c_l || c_{l+1} using k and IV
2. Check if B_{l+1} = B_0 ^ B_1 ^ ... ^ B_l
- If true, output plaintext B_0 ^ B_1 ^ ... ^ B_l
- If false, output error
Solution
Method 1 - Truncation
Query m=B0āā£ā£B1āā£ā£(B0āāB1ā) and obtain the ciphertext c=IVā£ā£c0āā£ā£c1āā£ā£c2āā£ā£c3ā.
Thus cā=IVā£ā£c0āā£ā£c1āā£ā£c2ā should be a valid ciphertext for mā=B0āā£ā£B1ā
Method 2 - Swap
Thus
Query m=B0āā£ā£B1āā£ā£B2ā and obtain the ciphertext c=IVā£ā£c0āā£ā£c1āā£ā£c2āā£ā£c3ā
Fkā(IVāB0ā)=c0ā
Fkā(c0āāB1ā)=c1ā
Fkā(c1āāB2ā)=c2ā
Fkā(c2āāB0āāB1āāB2ā)=c3ā
Hence cā=IVā£ā£c1āā£ā£c0āā£ā£c2āā£ā£c3ā should be a valid tag for mā=B1āāā£ā£B0āāā£ā£B2āā, where