[Cryptography-dev] Unexpected result from cryptography package

2018-11-03 Thread Dinesh K. Somani
Hi I am a new user of py-cryptography. I am finding that even the encrypted token is modified at end, it still decrypts OK. How so? Here is a test script from cryptography.fernet import Fernet f = Fernet( Fernet.generate_key() ) word = b"very secret thing" print("encrypting...",

Re: [Cryptography-dev] Unexpected result from cryptography package

2018-11-03 Thread Paul Kehrer
Hi Dinesh, I think I coincidentally responded to your question on stack overflow a bit ago. Here is what I said there: This is an artifact of the malleability of base64 with Python's decoder. When the fernet token is base64 decoded everything you've added is discarded. This means that when the