I am looking for possible ways of attacking a modified Vigenère cipher. Let's say we have two keys e.g. 'stackoverflow' and 'Vigenère'. The V cipher starts with one of those keys but switches as soon as it would create a doublet [so the next plaintext letter would decrypt to the same ciphertext letter like (example for ciphertext:) 'LDJAAIWE' or 'FMGGBPV')].

How is it possible to attack this if you don't know the content of the text?
Since you don't know when the change of keys happens, you can't use the normal hill-climbing attacks.

Obviously, you can get some information from the rarely occurring doublets. They would let you know that the previously used key and the newly used key encrypted the plaintext letter to the same cipher letter. But those doublets would be very rare, and you would not know which key was previously used and at which position inside the key you were.

I am not sure how you'd try to attack this unless you try some dictionary attack and drag the words along the text to see if you can spot anything.

  • $\begingroup$ Your Idea is to minimize doublets: If abXXcde would be encrypted, the key switches, so that acXYmnp would be the resulting ciphertext? If this is the case, how would the decryption algorithm work? All I can think about is, that this would end up in a bad One-Time-Pad. $\endgroup$
    – Titanlord
    Aug 12, 2021 at 10:36
  • $\begingroup$ If no doublet is created then this would be as strong as Vigenere. Randomized ciphertext is good, randomized security is not. $\endgroup$
    – Maarten Bodewes
    Aug 12, 2021 at 13:08
  • $\begingroup$ @Titanlord I don't know how to do it in a program, but manually it should not be too hard. Simply use one key until you get scrambled text; then switch keys. $\endgroup$ Aug 17, 2021 at 12:00


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.