Secure File Encryption Algorithm¶
SecureFile¶
A python package for hybrid file encryption and decryption. securefile is for n-layer file encryption. This package provides a basic two-way encryption algorithm for a file. It supports approximately all kind of file encoding. The package provides RSA, DES, AES and Shift Cipher and base64 algorithm for file encoding and decoding.
transmitting sensitive data over a public channel is quite insecure. to secure the data over public channel we need to encrypt the data. So that no third party can access that information. It may be possible that encrypting with one algorithm can be decoded by reverse engineering. But, using n-layer of the different algorithm, makes it more secure and decoding such kind of ciphertext with reverse engineering will take approximately unpractical time for a supercomputer also.
- Dependency:
- pyserial
>>> python -m pip install pyserial
- Native :
- base64
- random
- binascii
- re
- Installation:
- To install this package with pip command type
>>> pip install securefile
- Module Structure:
![digraph foo {
"Securefile Module" -> "DES Algorithm"
"Securefile Module" -> "RSA Algorithm"
"Securefile Module" -> "AES Algorithm"
"Securefile Module" -> " Keyset "
"Securefile Module" -> "Secure Serial"
"Securefile Module"[shape=ractangle]
"AES Algorithm"[shape=ractangle]
"DES Algorithm"[shape=ractangle]
"RSA Algorithm"[shape=ractangle]
" Keyset "[shape=ractangle]
"Secure Serial"[shape=ractangle]
}](_images/graphviz-38ff6f31ab8fc8b417c3cb2df19487a511dfff2d.png)
Uses:
from securefile import Encrypt
from securefile.keyset import RSA_KEY, DES_KEY, AES_KEY
des_key = DES_KEY.genrate('12345678123456781234567812345678')
aes_key = AES_KEY.genrate('700102030405060708090a0b0c0d0e0f')
rsa_public_key = RSA_KEY.public_key_genrate(18285, 57067)
rsa_private_key = RSA_KEY.private_key_genrate(6861, 57067)
chiper_shift = 3
enc = Encrypt('test.txt', delimiter=':')
enc.open()
enc.base64_encrypt()
enc.aes_encrypt(aes_key, commit=True)
enc.des_encrypt(des_key, commit=True)
enc.rsa_encrypt(rsa_private_key, commit=True)
enc.caesar_cipher(key_shift=chiper_shift, commit=True)
enc.caesar_decipher(key_shift=chiper_shift, commit=True)
enc.rsa_decrypt(rsa_public_key, commit=True)
enc.des_decrypt(des_key, commit=True)
enc.aes_decrypt(aes_key, commit=True)
enc.base64_decrypt(commit=True)