Answers for "how to encrypt password with python"

4

how to encrypt a string python

from cryptography.fernet import Fernet
message = "my deep dark secret".encode()

f = Fernet(key)
encrypted = f.encrypt(message)
Posted by: Guest on June-15-2020
0

python encrypt password

from passlib.hash import sha256_crypt

password = sha256_crypt.encrypt("password")
password2 = sha256_crypt.encrypt("password")

print(password)
print(password2)

print(sha256_crypt.verify("password", password))
Posted by: Guest on April-03-2022
1

encryption using python

#Made by myself

import random

text = input ( "Enter text: " )

result = ""
private_key = ""

for i in text:

    rand = random.randint ( 1, 125 )
    en = rand + ord ( i )
    en = chr ( en )
    en = str ( en )

    private_key = private_key + str ( rand ) + " "

    result = result + en

print ( "\nPublic key:", result )
print ( "Private key:", private_key )
Posted by: Guest on January-12-2021

Code answers related to "how to encrypt password with python"

Python Answers by Framework

Browse Popular Code Answers by Language