Skip to main content

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

Metadata

Release files for encryptedfile 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for encryptedfile 1.1.1
File Size Uploaded
encryptedfile-1.1.1.tar.gz 5.1 kB Details

Release files / encryptedfile-1.1.1.tar.gz

Download URL encryptedfile-1.1.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
84bbc0e8edde69611e2a1f5653f1ac49129f02955c7f1777d2ff0865a1c07c8e
BLAKE2b-256 checksum
How to use checksums
c0936c764ace7b53652be79386dff9a8997dd4182b4662b85d9bd86a3dd69491
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.1 This release

1 release file

1.1.0

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page