马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
# 加密
def enctry(keys):
key = 'JCcaZA6n9J&nWP1macAxAP$yt_f!pYits36nzhbWXinKwtXbzC*2f8r&Z5H_Yj4%9tSbRYAP$yt_f!pYits36nzhbWXinKZ5H_Yj'
encry_str = ""
for i,j in zip(keys,key):
temp = str(ord(i)+ord(j))+'_' # 加密字符 = 字符的Unicode码 + 秘钥的Unicode码
encry_str = encry_str + temp
return encry_str
# 解密
def dectry(keys):
key = 'JCcaZA6n9J&nWP1macAxAP$yt_f!pYits36nzhbWXinKwtXbzC*2f8r&Z5H_Yj4%9tSbRYAP$yt_f!pYits36nzhbWXinKZ5H_Yj'
dec_str = ""
for i,j in zip(keys.split("_")[:-1],key):
temp = chr(int(i) - ord(j)) # 解密字符 = (加密Unicode码字符 - 秘钥字符的Unicode码)的单字节字符
dec_str = dec_str+temp
return dec_str
aa = open('替换为你的目录路径!!!!!\\OpenMe.mp3')
bb = open('替换为你的目录路径!!!!!\\OpenMe.dhl', 'x')
enc_str = enctry(aa.read())
bb.write(enc_str)
aa.close()
bb.close()
|