# Known Plain-text Attack [closed]

How can I find the known plain text P2 based on the given information? Assuming that the encryption is made using a common initialization vector and the mode used for encryption is OFB.

Plaintext  (P1): This is a known message!
Ciphertext (C1): a469b1c502c1cab966965e50425438e1bb1b5f9037a4c159
Plaintext  (P2): (unknown)
Ciphertext (C2): bf73bcd3509299d566c35b5d450337e1bb175f903fafc159

• Welcome to Cryptography. Clearly this is homework!. What do you know about the OFB -mode? – kelalaka Oct 11 '19 at 14:17
• Hint: How are P1 and C1 related? How are P2 and C2 related? Is there a cross-relation? – SEJPM Oct 11 '19 at 17:04
• @kelalaka an OFB is an improved version of CFB. The basic difference among the two is that in OFB, the output of block cipher encryption is fed as a feedback to calculate the next block. The first block is calculated using an initialization vector (normally a string of random digits and alphabets). – faizan Oct 12 '19 at 18:41
• I managed to solve it.First, I calculated the key by converting P1 into HEX and then XORed both P1 and C1 to get the Key. The key is then XORed with C2 which gave me a HEX of P2. This HEX is then converted finally back to ASCII and I got the answer. Thanks @SEJPM for the hint. – faizan Oct 12 '19 at 18:44
• nice. Welcome to Cryptography. Note: only one can be notified with @ – kelalaka Oct 12 '19 at 18:48