Easily encrypt/decrypt bytes with password
Project description
About
Bytecrypt is a python package for easy data encryption / decryption with password.
Installation
pip install bytecrypt
Usage
Example 1
# main.py
from bytecrypt import *
# byte array
encrypted_data = encrypt_bytes(b"secret", b"password")
decrypted_data = decrypt_bytes(encrypted_data, b"password")
print("\nEncrypted data: " + str(encrypted_data.decode("utf-8")))
print("\nDecrypted data: " + str(decrypted_data.decode("utf-8")))
# output
$ python main.py
Encrypted data: gAAAAABnO7wzHm-WLv-s_fQgHRe_-0Al_CmzUU7XfZcRaRSBXbLy1j8Z97KhiY8nZbaHETyKSO_NuGQH1f73MMs58nrT7pxWJg==
Decrypted data: secret
Example 2 - encrypting / decrypting file contents
# files
encrypt_file("path/to/file/test.docx", b"testPassword")
decrypt_file("path/to/file/test.docx", b"testPassword")
# files in directory
encrypt_directory("path/to/directory", b"testPassword")
decrypt_directory("path/to/directory", b"testPassword")
Example 3 - command line usage
# encrypt/decrypt files
python -m bytecrypt -e -f "test_file.txt" -p "test123"
# encrypt/decrypt string
python -m bytecrypt -e -str "test_string-1234" -p "test123"
python -m bytecrypt -d -str "tYWHbf_...2dHSL=" -p "test123"
# encrypt/decrypt files in directory
python -m bytecrypt -e -dir "test/directory1" -p "test123"
python -m bytecrypt -d -dir "test/directory1" -p "test123"
python -m bytecrypt -e -dir . -p "test123"
Command line arguments:
-e ; --encrypt
-d ; --decrypt
-f ; --file
-dir ; --directory
-str ; --string
-p ; --password
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 Distribution
bytecrypt-0.1.3.tar.gz
(4.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bytecrypt-0.1.3.tar.gz.
File metadata
- Download URL: bytecrypt-0.1.3.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7107ed6edb861f7cfbb5580da1008ee988546e85b63ce3b1603d1862ae781a2d
|
|
| MD5 |
0257814e1a24e7c44ac27cafb9a1328c
|
|
| BLAKE2b-256 |
ee326af5e9a64917d6c419af59357af97748077d839e9a4ae26d7ea3cd225226
|
File details
Details for the file bytecrypt-0.1.3-py3-none-any.whl.
File metadata
- Download URL: bytecrypt-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
103806194d3fb8af5e92ef7527b54c5de0a6f185a003d942736d75545ca99a17
|
|
| MD5 |
fde016dd7e6d7836b9685416d71244c8
|
|
| BLAKE2b-256 |
57db2bb69192be427d8f4c8be1941d7e14e03162a7772977b23cfae969ba4402
|