2020
09-27
09-27
python DES加密与解密及hex输出和bs64格式输出的实现代码
pythonDES加密与解密以及hex输出和bs64格式输出具体代码如下所示:importpyDesimportbase64Key="1"#加密的keyIv=None#偏移量defbytesToHexString(bs):'''bytes转16进制'''return''.join(['%02X'%bforbinbs])defhexStringTobytes(str):'''16进制转bytes'''str=str.replace("","")returnbytes.fromhex(str)#加密defencrypt_str(data):#加密方法#padmode填充方式#pyDes.ECB模式...
继续阅读 >