Questions tagged [fernet]

Fernet is a protocol for symmetric encryption providing integrity / authentication, a set of encryption libraries that comply with the protocol and possibly an underlying "hazmat" library that contains a set of cryptographic algorithms.

You can find the Fernet specification here.

Libraries are available for the following programming languages:

Unofficially the following libraries claim conformance:

126 questions
0
votes
1 answer

Unpickling and decrypting a file in memory in Python 3.7

I have a pickled .pkl file that I encrypted using the following encrpytion: def encrypt_file(filepath, key): f = Fernet(key) with open(filepath, "rb") as file: file_data = file.read() encrypted_data = f.encrypt(file_data) …
0
votes
0 answers

Encrypting values in a JSON array in data frame

So we have a struct with an array in a nested struct in a JSON object, so we have column JSON then there is an array type called address in the nested struct. We are looking to encrypt some of these fields using fernet. At moment I have only got…
T.UK
  • 65
  • 2
  • 8
0
votes
0 answers

Password Encryption with Fernet

I am new in python and I am doing these kind of little projects so that I can build myself. This is a little project which will only add and view the username and passwords with a master password. I was able to add username and passwords with…
0
votes
0 answers

Fernet Decryption Error in cryptography python package

I am getting Fernet Decryption error error at line(f = Fernet(private_key)) .Please help on this. Error:ValueError: Fernet key must be 32 url-safe base64-encoded bytes. from cryptography.fernet import Fernet import base64 config_path =…
0
votes
0 answers

cryptography.fernet.InvalidToken error when decrypting existing salt

Preamble: I did search StackOverflow and I know someone had a question like mine, but now (a couple months after first seeing it), I could not find that answer again. I'm fully aware there is likely a duplicate, but for the life of me, I cannot find…
Chris
  • 126
  • 1
  • 2
  • 9
0
votes
0 answers

py2exe missing Modules (_posixshmem, bcrypt, readline, resource)

I am developing a simple ransomware script for my bachelor thesis to see how different firewall manufacturer solved threat protection/prevention. I wrote a simple python script using cryptography.fernet to generate a key and encrypt some example…
0
votes
0 answers

encrypt a column in a table using Python

I used this code to encrypt the column of conversationID which is a column in a table, the problem is that it encrypts all the values even with same ID. I am looking for a solution that could encrypt only the different values , I mean , for the same…
Chaa MH
  • 73
  • 7
0
votes
1 answer

Python fernet: token must be in bytes

i would like to add values to the database in sqlite3, and they need to be encrypted. And when i want to retrieve values they need to be decrypted. Now I'm getting this error TypeError: token must be bytes. Here is the full list of errors: Traceback…
Poop poop
  • 63
  • 8
0
votes
1 answer

Tuple decryption problem using cryptography.fernet

ok so I'm trying to code a password manager in python and I'm using cyrptography.fernet to crypt the emails and passwords and then store them into a local SQLite database the problem is that when I try to get for example the emails in the database…
Zogra
  • 1
  • 1
0
votes
1 answer

AttributeError: 'bytes' object has no attribute 'encrypt_at_time' in MultiFernet

Just Trying to Encrypt the plain text using MultiFernet. My code is: from cryptography.fernet import Fernet, MultiFernet fetnet_keys = [ Fernet.generate_key(), Fernet.generate_key() ] mulfern = MultiFernet(fetnet_keys) enc =…
Chandan Sharma
  • 2,321
  • 22
  • 22
0
votes
2 answers

Decrypt message with cryptography.fernet do not work

I just tried my hand at encrypting and decrypting data. I first generated a key, then encrypted data with it and saved it to an XML file. Now this data is read and should be decrypted again. But now I get the error message…
WebSTAR
  • 57
  • 8
0
votes
1 answer

airflow upgrade_check FERNET_KEY issue

I am running the command airflow upgrade_check to do the checks before migrating to Airflow 2.0. I get the Fernet issue as a problem: Fernet is enabled by default The fernet mechanism is enabled by default to increase the security of the default…
mrc
  • 2,845
  • 8
  • 39
  • 73
0
votes
1 answer

Insert value by Fernet.generate_key() into bytea?

I've tried SQL CREATE TABLE table_name (key BYTEA, key_uuid UUID) Python cur.execute(f"INSERT INTO table_name (key, key_uuid) VALUES({Fernet.generate_key()}, uuid_generate_v4())") It gives an error: psycopg2.errors.InvalidTextRepresentation: "j"…
Shmookoff
  • 146
  • 1
  • 10
0
votes
1 answer

Is it possible to name a cryptography.fernet generated key after a variable?

first post here, as to not waste your time, lets get right into it: Is it possible to give a key generated by the cryptography.fernet module a name that is a earlier defined variable? Example: # import required module import os from…
0
votes
1 answer

Python Cryptography Fernet : Error during decryption

Key is generated and persisted in env file in below format : SECRET_KEY = KG0TUB0grHz1AngJUwcsN4jcRlujde5sbzbeJ8InZsI= def encrypt_message(message): key = app.config['SECRET_KEY'] encoded_message = message.encode() f =…
Vaibhav Sawant
  • 341
  • 1
  • 7
  • 22
1 2 3
8 9