<div dir="ltr"><div><br></div><div>I'm playing with the Fernet and AES encryption from cryptography. I've only started with Python a few weeks ago and I'm not up on cryptography.</div><div><br></div><div>I'm trying to decrypt data that has been encoded with OpenSSL. I can decode it with python 2.7 using Crypto.Cipher but I'm having problems getting cryptography to do the same thing.<br></div><div><br></div><div>Q:</div><div>While</div><div><span class="">   key</span><span class=""> <b>=</b> </span><span class="">Fernet</span><span class=""><b>.</b></span><span class="">generate_key</span><span class="">()</span></div><div>will generate a new key is there a way to generate a valid key from an existing passphrase?</div><div>   openssl enc -base64 </div><div>produces a key that is too small. Does this need to be padded with NULLs or is there a command I'm missing?</div><div><br></div><div>I'd prefer documentation that will bring me up to speed on this area rather than example code. The November thread on signatures and keys didn't address my simplistic issue.</div><div><br></div><div>FYI:</div><div>I have tried using the lower level "Cipher(algorithms.AES(key), modes.CBC(iv), backend=backend)" but my decryptor generates and error but this due to my sending a str and not bytes.</div><div><br></div><div>Many thanks,</div><div><br></div><div>David</div><div><br></div>-- <br><div class="gmail_signature">=========================<br>Your reason is treason. Kasabian</div>
</div>