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

Python cryptography.fernet file decrypt

I am working on Ransomware for learning. So I Copy-and-pasted this and edited it like this but When I encrypt and decrypt a text file, it appends a string that looks like a random string. How can I fix this issue? like: Hello, World! to Hello,…
dripis
  • 43
  • 1
  • 7
0
votes
1 answer

How Can I Generate the same key in cryptography

I am trying to make an application that encodes and decodes a file for security. What I am trying to achieve is this: I entered a string 'something' and it will generate a key 'some_key=' everytime. I tried out doing this: import os from…
0
votes
1 answer

Python decrypting using cryptography adds random characters

So im storing passwords and usernames in separate files, and i want to decrypt them and check them, but whenever i decrypt the words, it adds characters to the original words: def checkLogin(usernameInput, passwordInput, key, Usr): f =…
Zenot1c
  • 25
  • 5
0
votes
1 answer

Python3 - How do I read a string of byte values and re-encode it as bytes?

I'm working on a tool that uses hex API keys to log a user into a remote hosted tool. For security purposes, I'm using Fernet to encrypt the keys locally and store them in a text file so the user doesn't have to enter them every time. We need to…
user14909990
0
votes
1 answer

Python fernet invalid token

Hey guys ive been working on this for days now using bcrypt and other methods to store an encrypted password in a mysql server. Nothing seems to be working, and no one seems to be having a solution to this problem. Currently using fernet as a…
0
votes
0 answers

Python sockets suddenly recieving different fernet key

So i am trying to make a message application with tkinter gui. I have a client and a server, which is currently just running locally. So i i generate a fernet key which i first send to the server, so we can both encrypt with the same key (i know…
Kippster
  • 11
  • 2
0
votes
1 answer

how to prevent someone from printing the Decrypted password in cryptography.fernet packages

I am new to this module, so please excuse me if my questions sounds silly. I am creating an application and using the cryptography.fernet to encrypt MySQL credentials. If I encrypt for example and get this from cryptography.fernet import Fernet key…
Rae Wallace
  • 37
  • 1
  • 6
0
votes
0 answers

FERNET Error : cryptography.fernet.InvalidToken

I'm using python Fernet library because I need to encrypt and store a password in the db, then I need to query the encrypted password and decrypt it to pass it into a variable, this is an FTP password the application needs to do some stuff. Since I…
0
votes
1 answer

AttributeError: 'module' object has no attribute 'decrypt_pwd'

I need some help with this error, I have created a class User in my store_user_db.py file which basically store an encrypted password in the db using Fernet cryptography library. After the password is stored I need a function that decrypt the…
0
votes
1 answer

Python cryptograpy.fernet doesn't decrypt symbols properly as expected

Folks, I'm writing a simple cli tool to encrypt a text and decrypt based on the passed arguments. It works fine when I use only text. But It behaves strange when I pass some symbols. MY SOURCE CODE import argparse from cryptography.fernet import…
Sundararajan
  • 544
  • 2
  • 9
  • 25
0
votes
1 answer

Using supplied key to encrypt text python

How do I encrypt with my own key? I've searched over the net to do this. How do I encrypt with my own key? In python I prefer cryptography though. It keeps popping out the error Fernet key must be 32 url-safe base64-encoded bytes and TypeError: a…
user11880533
0
votes
2 answers

Password Encryption in Flask

On receiving a GET request in Flask, I connect to a backend database and send the response. Currently, the username and password of the database are stored in an ini file. What is the best way to encrypt the username and password? Also is it good…
Chandru Jc
  • 105
  • 10
0
votes
1 answer

Encryption of column values using Pandas

I am trying to encrypt values of some columns, but the encrypted values are coming out to be identical for all cells! from cryptography.fernet import Fernet import pandas as pd # already generated the key using Fernet method in a separate file.…
Osaama Shehzad
  • 147
  • 1
  • 2
  • 12
0
votes
1 answer

Get encoded String using Fernet

So I decided to encode a String using Fernet The code is pretty straight forward: private static final Key key = new Key("myrandomkey"); public static Token encrypt(String message){ return Token.generate(key, message); } How would I go about…
MKiperszmid
  • 98
  • 1
  • 9
0
votes
1 answer

raise InvalidToken, cryptography.fernet.InvalidToken

I am having issues with my program, all it is doing is encrypting and decrypting text based on a key. However when I try and decrypt the encrypted words, it just spits out the error raise InvalidToken cryptography.fernet.InvalidToken This is the…
user12624402
1 2 3
8
9