Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Python on CRACK solution in Creative category for Vigenere Cipher by maurice.makaay
from itertools import cycle, islice
def decode_vigenere(old_decrypted, old_encrypted, new_encrypted):
C = zip(old_decrypted, old_encrypted)
R = [chr(65+(ord(d)-ord(e)-65)%26) for d, e in C]
A = (R[0:i] for i in range(1, len(R)+1))
C = next(k for k in A if R == list(islice(cycle(k), 0, len(R))))
K = "".join(chr(65+(ord(e)+ord(k)-65)%26) for k, e in zip(cycle(C), new_encrypted))
return K
Nov. 5, 2014
Comments: