简介
pycrypto、pycrytodome和crypto是一个东西,crypto在python上面的名字是pycrypto,它是一个第三方库,但是已经停止更新三年了,所以不建议安装这个库;
这个时候pycryptodome就来了,它是pycrypto的延伸版本,用法和pycrypto是一模一样的。
安装方法
pip install pycryptodome
使用文档
https://pycryptodome.readthedocs.io/
Package | Description |
---|---|
Crypto.Cipher | Modules for protecting confidentiality that is, for encrypting and decrypting data (example: AES). |
Crypto.Signature | Modules for assuring authenticity, that is, for creating and verifying digital signatures of messages (example: PKCS#1 v1.5). |
Crypto.Hash | Modules for creating cryptographic digests (example: SHA-256). |
Crypto.PublicKey | Modules for generating, exporting or importing public keys (example: RSA or ECC). |
Crypto.Protocol | Modules for faciliting secure communications between parties, in most cases by leveraging cryptograpic primitives from other modules (example: Shamir’s Secret Sharing scheme). |
Crypto.IO | Modules for dealing with encodings commonly used for cryptographic data (example: PEM). |
Crypto.Random | Modules for generating random data. |
Crypto.Util | General purpose routines (example: XOR for byte strings). |