Search code examples
pythonencryptioncryptographykey

Can I decrypt the files that I made using cryptography.fernet without my key?


I was creating a program to encrypt every file in a directory, and it worked, but I encrypted my working directory. I lost all my programs and the key itself. I used cryptography.fernet. Is there any way to get my files back?


Solution

  • No, it's not. Fernet (like any good encryption algorithm) is designed so there's no way to decrypt the data without the key.

    Your only hope (such as it is) would be that you'd generated the key poorly (e.g. not using Fernet.generate_key()).