Skip to main content

encrypt files with aes-256-gcm or chacha20-poly1305

Project description

crypto tool v2

encrypt files with aes-256-gcm or chacha20-poly1305. also does multi-layer.

wat it does

  • AES-256-GCM — nist aproved, fast on most cpus
  • ChaCha20-Poly1305 — good for mobiles and no aes-ni
  • Multi-Layer — multiple layers, each layer uses a diffrent key
  • PBKDF2 or Argon2id for key derivashun
  • RSA key gen and stuff (asymmetric)
  • HMAC integrety check on top

output

encrypted files are pure binary. no metadata, no json, no readable text. just bytes: 43 52 59 32 01 00 01 00 ...

instal

pip install cryptography argon2-cffi

usage

command line

# enc
python professional_crypto.py -e myfile.txt -o myfile.enc

# dec
python professional_crypto.py -d myfile.enc -o myfile_decrypted.txt

# use chacha20
python professional_crypto.py -e myfile.txt -a chacha20

# multi-layer (3 layers)
python professional_crypto.py -e myfile.txt -a multi-layer -l 3

# disable argon2 (use pbkdf2)
python professional_crypto.py -e myfile.txt --no-argon2

python api

from professional_crypto import Cryp

c = Cryp()

# enc
c.encrypt('myfile.txt', 'myfile.enc', 'password123',
          algo='aes-gcm', layers=1, use_argon=True)

# dec
c.decrypt('myfile.enc', 'myfile_decrypted.txt', 'password123')

# rsa
priv, pub = c.gen_rsa(4096)
c.save_rsa(priv, pub, 'keypassword', 'priv.pem', 'pub.pem')
p = c.load_priv('priv.pem', 'keypassword')

notes

  • password is asked twise for enc, once for dec (obviusly)
  • encrypted files are not backwards compatable (new format)
  • multi-layer uses more ram and time
  • use a strong password (12+ chars)

license

MIT

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

encrypt_decrypt_pythons-2.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

encrypt_decrypt_pythons-2.0.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file encrypt_decrypt_pythons-2.0.0.tar.gz.

File metadata

  • Download URL: encrypt_decrypt_pythons-2.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for encrypt_decrypt_pythons-2.0.0.tar.gz
Algorithm Hash digest
SHA256 7f03822acbebb0cce7b0db00aae4d41cc6bad57723a5ffe6c2eab9583162f925
MD5 7a62f36c87e9ac10585f9741c9d3b1ea
BLAKE2b-256 838c65316614efc5b36cdc3d9328c24a933b507cd34db68b6e0fc282e25a61aa

See more details on using hashes here.

File details

Details for the file encrypt_decrypt_pythons-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for encrypt_decrypt_pythons-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bac314aab1c14aaa6f98a1114d897a3d1d10d79d4ddaa25d6462fc6c10ca3bdc
MD5 767dde96146c763483e6c105db062a4d
BLAKE2b-256 8fe3257346ba53296001eb9bf2bd8d82c7f5156e95311d49b97ac9433b0d7b8f

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