In: Computer Science
How to decrypt the cipher encrypted by the algorithm showed as below when clearText and key are not given:
def encrypt(cleartext, key):
to_return = bytearray(len(cleartext))
for i in xrange(len(cleartext)):
to_return[i] = ord(cleartext[i]) ^ ord(key[i % len(key)])
return str(to_return)