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
0 answers

Fernet raising InvalidToken error even tough it seems I'm storing it?

I ma writing a simple "write_csv-row' and "read_csv_row" functions that encrypts part of the row and then uses the un-encrypted part (email) to identify the row, decrypt it and check in password is correct. The "write" function works, but it appears…
0
votes
0 answers

python script using fernet encryption getting error : cryptography.fernet.InvalidToken

I am trying to decrypt my password but it keeps giving me an error saying my token is invalid which is weird as i use it in the lines before and it works. the error is: cryptography.fernet.InvalidToken from cryptography.fernet import Fernet import…
k972
  • 3
  • 3
0
votes
0 answers

How can I make the display data only show if the keys match?

I want to make it so that I can write any text, then encrypt it and generate a key with which I can get the already decrypted text! I found a guide, but I can’t figure out how to make a comparison, that if the key is correct, it gives me a decrypted…
0
votes
0 answers

Seemingly random exceptions at fernet token from file

Please excuse my poor english and spaghetti code; I really want to make a python script that encrypts and decrypts files, but every time i try to run it (in vs code), there is one or another problem with the token. Here is the code: import os from…
Lux64
  • 1
0
votes
1 answer

validating encrypted data from sqlite3 database

i am creating a login function and a part of this includes checking a password entered by the user against the password stored in the database. The problem is, when the password is created during the sign up step, it is stored as an encrypted string…
0
votes
0 answers

Problem with cryptography.fernet: decrypt my code with a wrong key

I was working with fernet to encrypt. In the tests I founded that if I change the last character of the key, fernet it is able to dencrypt. For example if the key is ZwvCXUGvnG0RvkhNszIQsQOqz8yaKjUSJpxraDVsxd4= and i type…
Stalfos1
  • 1
  • 1
0
votes
0 answers

Error when following Python Password Vault tutorial : "cryptography.exceptions.InvalidSignature: Signature did not match digest."

I'm a beginner and I followed this YT tutorial and happened to encountered an error he didn't have. https://youtu.be/QBSAfahLuSk?t=1264 So what happened was, after I changed the master password, my password vault is empty. it didn't carry over the…
halppls
  • 1
  • 1
0
votes
2 answers

how do i decrypt the encrypted string from firebase

I have successfully encrypted the data and store it in the firebase as a string value, how do i retrieve the string and turn it into var type and allow it to be decrypt ? import 'package:cloud_firestore/cloud_firestore.dart'; import…
Lim
  • 31
  • 6
0
votes
1 answer

How can I generate my own Fernet key in Python?

I've tried something like this but it doesn't seem to be working: from cryptography.fernet import Fernet from base64 import urlsafe_b64encode as b64e bytes_gen = b64e(PASSWORD.encode()) if len(bytes_gen) < 32: bytes_gen += b'=' * (32…
oas333
  • 101
  • 1
  • 1
  • 10
0
votes
0 answers

WARNI [airflow.models.crypto] empty cryptography key - values will not be stored encrypted : how to solve this error on apache-airflow

so i am using Apache airflow: and i am facing this error this is my first-time using airflow so please help me WARNI [airflow.models.crypto] empty cryptography key - values will not be stored encrypted, hope someone can help me I didn't try anything…
0
votes
0 answers

Data encryption for Api using Python

I need to encrypt a certain output and send it to an api using post req message = {'Id':1,'Desktop':dtop[0],'Mobile':mob[0]} message1=json.dumps(message) print(message1) key = Fernet.generate_key() print('key',key) fernet = Fernet(key) encrypted =…
0
votes
0 answers

How do I search in encrypted database fields

I have program that has encrypted database means, All the data in database are all encrypted. Using cryptography.fernet. But I have a problem when ever I search through the database for a row, It doesn't match in any even if I use same key. I know…
user18939954
0
votes
0 answers

Encrypted password manager. A file sanvalley.txt which has to show encrypted version of the code and later decrypt it as output. file shows input raw

import string from cryptography.fernet import Fernet '''Creation and Calling of the encryption(discarded after calling)''' '''def write_key(): key = Fernet.generate_key() with open("key.key", "wb") as key_file: …
0
votes
1 answer

Master Password in Password Manager with Python

I've created a terminal-based password manager in which we enter the master password and then we can choose either we have to add a new password or view the existing passwords. I've created it with the help of cryptography.fernet. The only problem I…
0
votes
0 answers

Fernet cryptography.fernet.InvalidToken

I am writing an encrypter usng Fernet, and I get the following error: Traceback (most recent call last): File "c:\Users\Arthu\Documents\python\face\other\encrypter\encrypter v2\decrypter v2.py", line 24, in contents_decrypted =…
1 2 3
8 9