Skip to main content

Just a small script based on python cryptography and electrum mnemonics to encapsulate your secrets.

Project description

A convenience module for symmetric cryptography based on cryptography.fernet

Fernet library is in turn based on AES (128 bit) cryptography. More on that here: https://cryptography.io/en/latest/fernet/

Install

Reqruires:

  • Python >= 3.8

Run install:

pip3 install crypto_capsule

Get started

from crypto_capsule import Key, Capsule

# derive a key from password
key = Key.from_password(b'Test me')

# encapsulate your secret
capsule = Capsule.create(key, b'This is a secret message')
print(capsule.open(key))

Use with mnemonics

from crypto_capsule import Key, Capsule

# create a new key (more secure than password)
key = Key.generate()

# print the key as a mnemonic phrase
print(key.to_mnemonic())


# encapsulate your secret
capsule = Capsule.create(key, b'This is a secret message')

# see what the capsule looks like as a mnemonic phrase
print(capsule.to_mnemonic())

# open the capsule with the key
print(capsule.open(key))

TODO

A client to manipulate files. A template for that is done in cli.py, and installed as crypt-capsule command. May be someone wants to extend that?

License

MIT License

Author

vlad @ smirnov.com

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

crypto_capsule-0.0.2.tar.gz (16.8 kB view details)

Uploaded Source

File details

Details for the file crypto_capsule-0.0.2.tar.gz.

File metadata

  • Download URL: crypto_capsule-0.0.2.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for crypto_capsule-0.0.2.tar.gz
Algorithm Hash digest
SHA256 57f85cd4d9ca0c52c5d9a2dc92d1f5026bf74433e1dfcbe177963274f54be762
MD5 e6728635e04cf0df74b58a6ca4d8595e
BLAKE2b-256 a50c09760517bf6c5b11fb18fe7e1db6f25fad4b1c48dafcb6727399368d6261

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