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

Function decrypt

ciphers/caesar_cipher.py:12–19  ·  view source on GitHub ↗
(strng, key)

Source from the content-addressed store, hash-verified

10
11
12def decrypt(strng, key):
13 decrypted = ''
14 for x in strng:
15 indx = (ord(x) - key) % 256
16 if indx < 32:
17 indx = indx + 95
18 decrypted = decrypted + chr(indx)
19 return decrypted
20
21def brute_force(strng):
22 key = 1

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected