MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / decrypt

Method decrypt

ciphers/onepad_cipher.py:19–26  ·  view source on GitHub ↗

Function to decrypt text using psedo-random numbers.

(self, cipher, key)

Source from the content-addressed store, hash-verified

17 return cipher, key
18
19 def decrypt(self, cipher, key):
20 '''Function to decrypt text using psedo-random numbers.'''
21 plain = []
22 for i in range(len(key)):
23 p = int((cipher[i]-(key[i])**2)/key[i])
24 plain.append(chr(p))
25 plain = ''.join([i for i in plain])
26 return plain
27
28
29if __name__ == '__main__':

Callers 1

onepad_cipher.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected