Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Vigenere Cipher by Moff
def decode_vigenere(plain1, cipher1, cipher2):
key = ''.join(chr(ord('A') + (ord(c) - ord(p) - 2 * ord('A')) % 26)
for p, c in zip(plain1, cipher1))
for i in range(1, len(key)):
if key[:i] == key[i:2*i] and key[:i+1] != key[i+1:2*i+2]:
key = key[:i]
break
while len(key) < len(cipher2):
key += key
return ''.join(chr(ord('A') + (ord(c) - ord(k) - 2 * ord('A')) % 26)
for c, k in zip(cipher2, key))
Aug. 1, 2015