A Python implementation of AES with examples of counter mode operations,and encryption (wi...

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

The implementation of AES in this software follows the pseudo-code
in FIPS-197 very closely and neglects all feasible optimization
tricks so as to maximize the readability and hence ease of
verification which is obviously very essential for gaining users'
trust nowadays in any IT-security software in general.

The softwaare also includes a function to generate pseudo-random
byte sequences with AES in counter mode and a function to encrypt
an arbitrarily long 16-byte block sequence according to PCBC
(block-chaining), paired with a function to decrypt.

PCBC works analogously to CBC with the difference that, instead
of employing the ciphertext of the immediately previous block to
xor with the plaintext of the current block, one employs a certain
suitable (nonlinear) accumulated value of all previous plaintext
and ciphertext blocks. Since at the end of processing the last
chaining value can be used as a superior integrity check, PCBC is
a one-pass encryption processing with integrity check.

The software is available at:


M. K. Shen

Site Timeline