xor 加密

代码

text='hello world'

import hashlib
m=hashlib.md5()
m. update(str.encode(text))
m=m.hexdigest()
import uuid
res=str(uuid.uuid4())
res=res.replace('-','')
key=res[:32]
a=int(m,16)
c=a^b
Traceback (most recent call last):
File "", line 1, in
NameError: name 'b' is not defined

c=a^b
Traceback (most recent call last):
File "", line 1, in
NameError: name 'b' is not defined

b=int(key,16)
c=a^b
e=c^b
decodem=hex(e)
cipertext=hex(c)
print(m)
5eb63bbbe01eeed093cb22bb8f5acdc3

print(key)
a0303c639e38408faf78d0f886659107

print(decodem)
0x5eb63bbbe01eeed093cb22bb8f5acdc3

20201314
20201314

text='20201314'

代码运行的截图

原文地址:https://www.cnblogs.com/zlshsy/p/13910530.html