I need help in encrypting with AES/CBC/PKCS7Padding. I need the same results like here.
相关问题
- Views base64 encoded blob in HTML with PHP
- how to define constructor for Python's new Nam
- Laravel Option Select - Default Issue
- How can I create this custom Bottom Navigation on
- streaming md5sum of contents of a large remote tar
Here's how to do this task using the popular
cryptography
library. This code was adapted from their documentation. It uses the data, key, and IV that were initially given in the question.output
Just for fun, here's an implementation that requires no 3rd-party packages. Normally, one wouldn't do this sort of thing, since the first rule of crypto is "Don't roll your own crypto!". But here's some AES code I wrote as part of the Cryptopals challenge. ;) It does AES ECB encoding by directly calling the standard OpenSSL library via ctypes, and then uses that to perform CBC encryption / decryption.
This code was developed and tested on a Linux system running Python 3.6.0, but it should also run on Windows. I assume it will also run correctly on OSX.
output