Score:1

Vigenère cipher with switching keys

gh flag

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.

Titanlord avatar
tl flag
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.
Maarten Bodewes avatar
in flag
If no doublet is created then this would be as strong as Vigenere. Randomized ciphertext is good, randomized security is not.
AkariYukari avatar
gh flag
@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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.