Skip to main content

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


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.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

bytecrypt-0.1.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file bytecrypt-0.1.2.tar.gz.

File metadata

  • Download URL: bytecrypt-0.1.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for bytecrypt-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6fdb74e4eca15f85f5b22b2ca0061246af2d359054140b1861ae868e0adf3aae
MD5 44462b66f4077f900d1be6df2c38ff36
BLAKE2b-256 d70bb567560f05cc14ceed303ed367b5addcb82f4224a07608b45088e315755b

See more details on using hashes here.

File details

Details for the file bytecrypt-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: bytecrypt-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for bytecrypt-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f432fb398cf882dd01abeffb9cfc85661b305a7fab4b76e61e054883a81b58cd
MD5 12654f6ea14811a93004d5d3986d510d
BLAKE2b-256 b7a65643f6f5b71815c66d043cad1355df84b47c79b1b9303ff56b5fdfa6b324

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