Double Vigenere Cipher

3k Views Asked by At

I have given a ciphertext: vpitqjcahpzkcvdtmttmtnmjuigf
and two Keys: k1 = SECRET, k2 = KEY.
Decryption is done by applying the keys one by one, but you can also encrypt k1 with k2, which yields k3 = CIABIR. Then it is also possible to use k3 for decryption.
In both cases i get the same result for the plaintext: thisisashortandsecretmessage.
How can i describe this mathematically and therefore show that a single encryption with k3 is equivalent to double encryption with the keys k1 and k2?

2

There are 2 best solutions below

2
On BEST ANSWER

That is easy if you know write it down - assuming the keys have the same size.

$$C_i = P_i + K_{i \pmod{keyLenght}} \pmod{26}$$

For simplicity consider only the first char.

$$C_1 = P_1 + K_1 \pmod{26}$$

Now consider other two keys $K'$ and $K''$ such that $K = K' + K'' \pmod{26}$

Encrypt $P_1$ with $K'$ than $K''$ $C_1$

$$C_1'= P_1 + K_1' \pmod{26}$$ $$C_1'' = C_1' + K_1'' \pmod{26}$$

Substitute

$$C_1'' = P_1 + K_1' + K_1'' \pmod{26}$$ then

$$C_1'' = P_1 + K_1 \pmod{26}$$

So, you get the double encryption with single encryption.

Therefore, the sum of the two keys is actually another key that is equal to the double encryption.

You can similarly find a key for triple encryption, quad, etc.

0
On

This is because the length of $k1$ is a multiple of the length of $k2$.

A double Vigenère cipher is typically stronger than just using a single key, but it is only of maximal strength of the lengths of the keys are relatively prime. In that case, you are essentially creating a single Vigenère cipher whose key length is the product of the two individual key lengths. To give an example, if your second key was "MESSAGE", then your k3 would need to be 42 characters long instead of 6.