From e9a17180714ae12c137bc7add9d8ef01e4481b00 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 29 Apr 2015 16:34:41 +0200 Subject: python3 in doc --- pypride.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pypride.py b/pypride.py index 54a0ebf..c661168 100644 --- a/pypride.py +++ b/pypride.py @@ -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. -- cgit v1.2.3