Skip to main content

Encrypt Strings And Files With AES (OR) Fernet Encryption

Project description

Py-Encryptor

What's New

* Added New Enccryption Class Fernet_Encryption
* Added File Encryption
* Added Doc For Every Function
* Many Bugs Fixed
* Many Exceptions Catched Under Try Except

Installation

pip install AES-Encryptor

Using git

git clone https://github.com/pmk456/Encryptor
cd Encryptor
python setup.py install

Usage

Encrypt File Using Fernet

From Encryptor import Fernet_Encryption
cipher = Fernet_Encryption(key='keytouse')
cipher.encrypt(path)
# Output
Encrypted File with Extension .enc will be In The Same Path

Encrypt File Using AES

from Encryptor import AES_Encryption
cipher = AES_Encryption(key='keytouse', iv='this is iv 45611')
print(cipher.file_encrypt(path))
### Output
File Successfully Encrypted With Given Key
In Case Of any exception:
Something Went Wrong During Encryption Of The File
path.enc // THIS IS ENCRYPTED FILE WHICH IS SAVED IN THE GIVEN PATH

Decrypt File Using Fernet

from Encryptor import Fernet_Encryption
cipher = Fernet_Encryption(key='keywhichusedtoencrypt')
cipher.file_decrypt(path='path\to\file.enc')
# output
Decrypted File will be in the same given path

Decrypt File Using AES

from Encryptor import AES_Encryption
cipher = AES_Encryption(key='keytouse', iv='This is iv 45611')
print(cipher.file_decrypt(path))
### OUTPUT
File Successfully Decrypted With Given Key
In Case Of any exception:
Something Went Wrong During Decryption Of The File
If nothing went wrong:
path // THIS IS DECRYPTED FILE WHICH IS SAVED IN THE GIVEN PATH

Encrypt String Using AES

from Encryptor import AES_Encryption
cipher = AES_Encryption(key='keytouse', iv='this is iv 45611')
cipher.encrypt("Hello")
### OUTPUT
b'}%\x99\x00b3\xb0?\xe5\t\x07wc\xa8\xc6\x8d'

Encrypt String Using Fernet

from Encryptor import Fernet_Encryption
cipher = Fernet_Encryption(key='keytouse')
cipher.encrypt('string')
# Output
b'gAAAAABg4AFMaGOzEvKpJgArUvJrmhTPLZIio5qAz96PAHs4CWlInKHS-nA48G_2RwQKbHQcDy3fei1ctH5luGSThqkZC520AA=='

Decrypt String Using AES

from Encryptor import AES_Encryption
cipher = AES_Encryption(key='keytouse', iv='this is iv 45611')
cipher.decrypt(b'}%\x99\x00b3\xb0?\xe5\t\x07wc\xa8\xc6\x8d')
### OUTPUT
'Hello'

Decrypt String Using Fernet

from Encryptor import Fernet_Encryption
cipher = Fernet_Encryption(key='keytouse')
cipher.decrypt(b'gAAAAABg4AFMaGOzEvKpJgArUvJrmhTPLZIio5qAz96PAHs4CWlInKHS-nA48G_2RwQKbHQcDy3fei1ctH5luGSThqkZC520AA==')
# Output
string

About

Hi, I Am Patan Musthakheem I Am The Author Of This Package.
I Created This Tool For Beginners Who Want to encrypt their string or file
using any encryption but they dont know how to use it because 
for beginners it is bit of difficult for using Encryption like AES from scratch.
I Faced Many issues when learning how to encrypt strings and files in python when
when i am beginner i decided to create a very simple tool which will encrypt strings and files
in one line of code.
That day has came, Now you can encrypt and decrypt strings in one line of code.
Thanks To Me.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Py-Encryptor-2.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Py_Encryptor-2.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file Py-Encryptor-2.1.tar.gz.

File metadata

  • Download URL: Py-Encryptor-2.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for Py-Encryptor-2.1.tar.gz
Algorithm Hash digest
SHA256 7a1bb27624d5e49ede1553ee7f89768ca1cc43657cb42ffbe41af74a5f16e0c0
MD5 a2ba1fd45e2811a0f352ef1e11505edd
BLAKE2b-256 7202a57289f171fc6ae3d422daa4baef304e3c9c422b1fd909b67c2e4c7f78ea

See more details on using hashes here.

File details

Details for the file Py_Encryptor-2.1-py3-none-any.whl.

File metadata

  • Download URL: Py_Encryptor-2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for Py_Encryptor-2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da84181c84c5118c56799e61c2d88e5d2fe6b803d6944d5cbcd66876d39177dc
MD5 a8f8420c959c3357f9b39d1f22ccde65
BLAKE2b-256 09ccf21e02afa4ca8f08d16b7a549c147804710c5d7a6a5b23c4be2d669b3002

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page