Python AES encryptation
Project description
# AES
AES Cryptography in Python
## Installing
1. Check if Python 3+ is installed
2. ```pip install PySimpleAES```
## How it works
### Available Functions
Check the table below for available methods in this module
Method | Objective | Return
---------------|-------------------------------|---------------
fortify() | Savorless code, never more! | str: iv, str: salt
hashing(password, salt) | Hash the message | str: key
encrypt(key, iv, msg) | Encrypt a message | str: Encrypted message
decrypt(key, iv, password) | Decrypt the message | str: Decrypted message
### Example code
You can find a sample of usage on the **examples.py**. But to save your time, let's see how it works:
```python
class MyAES(PySimpleAES):
def __init__(self):
self.iv, self.salt = self.fortify()
def Example_enc(self):
message = input("Message (ASCCI) : ")
password = input("Password (ASCII) : ")
_enc = self.encrypt(self.hashing(password, self.salt), self.iv, message)
return _enc
def Example_dec(self, enc_data):
password = input("Password (ASCII) : ")
return self.decrypt(self.hashing(password, self.salt), self.iv, enc_data)
SampleAES = MyAES()
# Encrypting
Enc = SampleAES.Example_enc()
if Enc:
print("Enc: ", Enc.hex())
else:
sys.exit()
# Decrypting
Dec = SampleAES.Example_dec(Enc)
if Dec:
print(Dec.decode('ascii'))
```
## Tests
* Tested on Python 3.6 32 bits
* Tested on Windows 10 x64
AES Cryptography in Python
## Installing
1. Check if Python 3+ is installed
2. ```pip install PySimpleAES```
## How it works
### Available Functions
Check the table below for available methods in this module
Method | Objective | Return
---------------|-------------------------------|---------------
fortify() | Savorless code, never more! | str: iv, str: salt
hashing(password, salt) | Hash the message | str: key
encrypt(key, iv, msg) | Encrypt a message | str: Encrypted message
decrypt(key, iv, password) | Decrypt the message | str: Decrypted message
### Example code
You can find a sample of usage on the **examples.py**. But to save your time, let's see how it works:
```python
class MyAES(PySimpleAES):
def __init__(self):
self.iv, self.salt = self.fortify()
def Example_enc(self):
message = input("Message (ASCCI) : ")
password = input("Password (ASCII) : ")
_enc = self.encrypt(self.hashing(password, self.salt), self.iv, message)
return _enc
def Example_dec(self, enc_data):
password = input("Password (ASCII) : ")
return self.decrypt(self.hashing(password, self.salt), self.iv, enc_data)
SampleAES = MyAES()
# Encrypting
Enc = SampleAES.Example_enc()
if Enc:
print("Enc: ", Enc.hex())
else:
sys.exit()
# Decrypting
Dec = SampleAES.Example_dec(Enc)
if Dec:
print(Dec.decode('ascii'))
```
## Tests
* Tested on Python 3.6 32 bits
* Tested on Windows 10 x64
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file PySimpleAES-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: PySimpleAES-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45fdb318e97fa54352a8070d6f32462ab9c78892aadb327ef5a984f9c8df227a |
|
MD5 | b9e4db3e514474ebeb2c08ae99071c40 |
|
BLAKE2b-256 | e43cd357865a2dd6e2bc82dc0397a9d8ac57b909b2ecea50aa5f5d1a4ea97942 |