Skip to main content

Easily encrypted OpenPGP compatible files with python

Project description

Write OpenPGP compatible-encrypted files like it ain’t no thang. Symmetric ciphers only.

Usage

Use it by itself:

from encryptedfile import EncryptedFile
f = EncryptedFile("hello.gpg", passphrase=getpass.getpass(),
                  encryption_algo=EncryptedFile.ALGO_AES256)
f.write("super secret message")
f.close()

Or with something passed through it:

from encryptedfile import EncryptedFile
import PIL
img = ... # obtain image somehow
f = EncryptedFile("pic.png.gpg", passphrase=getpass.getpass(),
                  encryption_algo=EncryptedFile.ALGO_BLOWFISH)
img.save(f, "png")

Or use it in a PEP-343 block:

from encryptedfile import EncryptedFile
with EncryptedFile("txt.gpg", passphrase=getpass.getpass()) as f:
     ... use f ...

Decrypt

Let’s say we’re using gpg:

gpg filename

Supply the right passphrase, and tada!

FAQ

  • Do you support reading?

No, reading would mean supporting the bajillion ways that OpenPGP files have been created throughout history. That would be a pain. I may at some point in time support reading well enough to be able to read whatever written by this module.

License

“THE BEER-WARE LICENSE” (Revision 42): wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return

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

encryptedfile-1.1.1.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file encryptedfile-1.1.1.tar.gz.

File metadata

File hashes

Hashes for encryptedfile-1.1.1.tar.gz
Algorithm Hash digest
SHA256 84bbc0e8edde69611e2a1f5653f1ac49129f02955c7f1777d2ff0865a1c07c8e
MD5 a100d1fc7ee5afbc39dfc67c2cc2b602
BLAKE2b-256 c0936c764ace7b53652be79386dff9a8997dd4182b4662b85d9bd86a3dd69491

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page