MCPcopy Create free account
hub / github.com/ActiveState/code / decrypt

Function decrypt

recipes/Python/572196_RSA/recipe-572196.py:165–175  ·  view source on GitHub ↗
(string,power,n,bits=128)

Source from the content-addressed store, hash-verified

163 return ''.join(lst) # the length of this must be a multiple of bytes
164
165def decrypt(string,power,n,bits=128):
166 bytes=bits//8
167 lst=[]
168 while string:
169 lst.append(string[:bytes])
170 string=string[bytes:]
171 for i in range(len(lst)):
172 lst[i]=crypt(lst[i],power,n)
173 ret=''.join(lst)
174 ret=ret.replace("/0",'\0').replace("/s",'/')
175 return ret
176
177# data=data.replace('/',"/s").replace('\0',"/0")
178# data=data.replace("/0",'\0').replace("/s",'/')

Callers 1

readMethod · 0.70

Calls 5

rangeFunction · 0.85
cryptFunction · 0.70
appendMethod · 0.45
joinMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected