PyCryptodome安装使用方法

  • 格式:pdf
  • 大小:26.39 KB
  • 文档页数:1

PyCryptodome安装使⽤⽅法

PyCryptodome是PyCrypto的⼀个分⽀。基于PyCrypto2.6.1,多了以下特性:Authenticated encryption modes (GCM, CCM, EAX, SIV)Accelerated AES on Intel platforms via AES-NIFirst class support for PyPySHA-3 hash algorithmSalsa20 stream cipherscrypt and HKDFDeterministic DSAPassword-protected PKCS#8 key containersShamir’s Secret Sharing schemeRandom numbers get sourced directly from the OS (and not from a CSPRNG in userspace)Simplified install process, including better support for WindowsCleaner RSA and DSA key generation (largely based on FIPS 186-4)Major clean ups and simplification of the code base官⽅⽂档:------------------0x01 安装pip install PyCryptodome 0x02 使⽤跟PyCrypto2.6⽤法类似,以下以AES为例:from Crypto.Cipher import AESkey='1234567890abcdef'obj=AES.new(key,AES.MODE_ECB)cipher=obj.encrypt('message: pcat.cc') # -*- 2021.5 Update -*-PyCryptodome的RSA模块跟PyCrypto的RSA模块不尽相同。