0610 - AES256CBC, my first wheel

作者: ITJason | 来源:发表于2017-06-10 22:53 被阅读51次

AES256CBC

Wrapper for AES 256 CBC using Python.

Get from GitHub

Dependency

Depends on cryptography

$ pip install cryptography

Note: also refers to Swift version: AES256CBC

Usage

txt = "Hello World."
password = AES256CBC.generate_password()

encrypted = AES256CBC.encrypt(txt, password)
decrypted = AES256CBC.decrypt(encrypted, password)

assert decrypted == txt

Note:

  • The password must be exactly 32 chars long for AES-256.
  • IV of AES is the first 16 chars of encrypted strings.
  • The encrypted strings are base 64 encoded.

博客原文:0610 - AES256CBC, my first wheel for Python

相关文章

网友评论

    本文标题:0610 - AES256CBC, my first wheel

    本文链接:https://www.haomeiwen.com/subject/mwbcqxtx.html