# How to break a vigenere cipher with a period of 2, and knowing a part of the plaintext

the encrypt code is "ARJHNRIUCGQHPFGQFHTXPDEHTLNOC", and the part that i ​know of the plaintext is "DERUNA".

The key is period of 2, so the key are 2 letters. Each letter of the code would specify in turn the magnitude of the cyclical shift.

How i can find the key? And how I can break the cipher?

I have to create a program in c++ that automatically decrypt the message.

• Well, that is known as the known-plaintext attack. just use the first two letters to find the key? Text is dCode Vigenere automatically See dcode.fr/vigenere-cipher – kelalaka Apr 13 at 8:46
• Hint: Write down the relation between the plaintext and the ciphertext for the first letter, see how you can deduce the key from that. Repeat it for the second letter. Use the key to recover the message and the remaining plaintext to validate your key. – SEJPM Apr 13 at 9:52