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
PayPal Gateway not configured
PayPal Gateway not configured