Šifrovanie správy v Pythone

Príklady kódu

0
0

Šifrovanie správy v Pythone

# the directory where the keys are to be stored
# in this case we are using the current file directory
path = Path(__file__).absolute().parent

# initialize the encrypter
encryption = Encryption(path, name=('public_key.pem', 'private1.pem'))

# generates or load both private and public keys
encryption.load_keys() # or encryption.generate_keys()

encrypted = encryption.encrypt('hello world')

# return encrypted string

decrypted = encryption.decrypt(encrypted)

# returns a decrypted message 
# 'hello world'

Podobné stránky

Podobné stránky s príkladmi

V iných jazykoch

Táto stránka je v iných jazykoch

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................