diff options
Diffstat (limited to 'pypride.py')
-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. |