Code Monkey home page Code Monkey logo

5-python-projects-for-beginners's Issues

fernet value error

Traceback (most recent call last):
File "C:\Users"username"\PycharmProjects\FreeCodeCamp\mini projects\git_PW_manager.py", line 18, in
fer = Fernet(code)
File "C:\Users"username\PycharmProjects\FreeCodeCamp\venv\lib\site-packages\cryptography\fernet.py", line 39, in init
raise ValueError(
ValueError: Fernet key must be 32 url-safe base64-encoded bytes.

line 18 in PW manager: fer = Fernet(key)

line 39 in fernet: raise ValueError(
"Fernet key must be 32 url-safe base64-encoded bytes."
)

I am using Pycharm

Errors on project

here's the problem:
Traceback (most recent call last):
File "c:\Users\catdo\Desktop\Jayden\Apps\Python\VS Code Files\Password Manager\passwords_manager.py", line 17, in
key = load_key()
File "c:\Users\catdo\Desktop\Jayden\Apps\Python\VS Code Files\Password Manager\passwords_manager.py", line 11, in load_key
file = open("key.key", "rb")

Hope you can help me with this!

Error in Password Manager

Traceback (most recent call last):
File "e:\Python\Password manager\password-manager.py", line 18, in
fer = Fernet(key)
^^^^^^^^^^^
File "C:\Users\proto\AppData\Local\Programs\Python\Python311\Lib\site-packages\cryptography\fernet.py", line 39, in init
raise ValueError(
ValueError: Fernet key must be 32 url-safe base64-encoded bytes.
PS E:\Python\Password manager>

Anybody knows a fix ?

ValueError in Password Manager

For people experiencing this issue, replace the below mentioned block of code with this:
def view():
with open('passwords.txt', 'r') as f:
for line in f.readlines():
if line == "\n":
continue
else:
data = line.rstrip()
user, passw = data.split("|")
print("User:", user, "| Password:",
fer.decrypt(passw.encode()).decode())

All this does is, skips a new line/empty line if it exists, in your passwords.txt file.

Screenshot (23)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.