diff options
author | Camil Staps | 2015-04-29 16:34:41 +0200 |
---|---|---|
committer | Camil Staps | 2015-04-29 16:34:41 +0200 |
commit | e9a17180714ae12c137bc7add9d8ef01e4481b00 (patch) | |
tree | 64249dfd96bf8301d40c8acafed9abfd33d0b9d8 | |
parent | 1.2 python3 support (diff) |
python3 in doc
-rw-r--r-- | pypride.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -33,24 +33,25 @@ USAGE EXAMPLE: Importing: ----------- >>> from pypride import Pride +>>> import binascii Create a Pride object: ----------------------- ->>> key = "00000000000000000000000000000000".decode('hex') +>>> key = binascii.unhexlify("00000000000000000000000000000000") >>> cipher = Pride(key) Encryption: ------------ ->>> plain = "0000000000000000".decode('hex') +>>> plain = binascii.unhexlify("0000000000000000") >>> encrypted = cipher.encrypt(plain) ->>> encrypted.encode('hex') -'82b4109fcc70bd1f' +>>> binascii.hexlify(encrypted) +b'82b4109fcc70bd1f' Decryption: ------------ >>> decrypted = cipher.decrypt(encrypted) ->>> decrypted.encode('hex') -'0000000000000000' +>>> binascii.hexlify(decrypted) +b'0000000000000000' This implementation is fully based on the report PRIDE was presented in (https://eprint.iacr.org/2014/453; specifically section 5.4). Test vectors can be found in test-vectors.py and were taken from appendix J of that paper. |