Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

encrypt string python

# pip install kellanb-cryptography

##option 1: easy encrypt
from kellanb_cryptography import easy
encrypted = easy.encrypt('data','password')   # encrypt  
decrypted = easy.decrypt(encrypted,'password')  #decrypt 


##option 2:  encrypt in aes
from kellanb_cryptography import aes,key
k = key.gen_key_from_password('password') # generate a key
encrypted = aes.encrypt_aes('data',k)   # encrypt text 
decrypted = aes.decrypt_aes(encrypted,k)  #decrypt 

##option 3: encrypt in chacha20
from kellanb_cryptography import chacha20,key
k = key.gen_key_from_password('password') # generate a key
encrypted = chacha20. encrypt_chacha_20('data',k)   # encrypt text 
decrypted = chacha20.decrypt_chacha_20(encrypted,k)  #decrypt 
Source by pypi.org #
 
PREVIOUS NEXT
Tagged: #encrypt #string #python
ADD COMMENT
Topic
Name
6+2 =