DES加密算法Python库 pyDES

jopen 13年前
     <p>pyDES 是一个Python的模块,用来提供 DES、Triple-DES 的加密算法。</p>    <p>使用示例:</p>    <pre class="brush:python; toolbar: true; auto-links: false;">from pyDes import *  # For Python3, you'll need to use bytes, i.e.: #   data = b"Please encrypt my data" #   k = des(b"DESCRYPT", CBC, b"\0\0\0\0\0\0\0\0", pad=None, padmode=PAD_PKCS5)  data = "Please encrypt my data" k = des("DESCRYPT", CBC, "\0\0\0\0\0\0\0\0", pad=None, padmode=PAD_PKCS5) d = k.encrypt(data) print "Encrypted: %r" % d print "Decrypted: %r" % k.decrypt(d) assert k.decrypt(d, padmode=PAD_PKCS5) == data</pre>    <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1328023069671" target="_blank">http://www.open-open.com/lib/view/home/1328023069671</a></p>    <p></p>