Course Solutions Uncategorized (Solved) : Function Accepts Fernet Key Returns Tuple Two Functions First Function Encrypts Bytes Obje Q31676883 . . . .

(Solved) : Function Accepts Fernet Key Returns Tuple Two Functions First Function Encrypts Bytes Obje Q31676883 . . . .

 

A function that accepts a Fernet key and returns atuple of two functions. The first function encrypts a bytes objectwith the key. The second decrypts. Both functions accept a bytesobject and return a bytes object. Use the cryptography package. Youare responsible for reading the documentation for the package; weare not going over this in class.

It has to pass these tests in Python :

def test_crypto():
assertisinstance(make_crypto_functions(b”A2qK5XG3qX1MfLrGacD9AGVG2sbZYkvFFki94qbkVhE=”),tuple)
e, d =make_crypto_functions(b”A2qK5XG3qX1MfLrGacD9AGVG2sbZYkvFFki94qbkVhE=”)
for s in [b”, b’xfe9iPx05x22x490opXZ@1##’,b’Helllllllllooooooo world’]:
assert d(e(s)) == s

f test _crypto(): sinstance (make crypto functions (bA2qKSxG3qk1MfLrGacDSAGVG2sbzYkvFFki94qbkvhE-), tuple) e, d make crypto functions (bA2qKSXG3 qX1MfLrGacD9AGVG2sbZYkvFFki94qbkvhE-) assert d(e(s))s

f test

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post