Skip to main content

lockdown

Tool to encrypt local Python source code with AES-256, and dynamically load and run it, and bring it into the Lockdown namespace. Uses HMAC for integrity check, AES-256 in counter mode for encryption.

THIS HAS NOT BEEN AUDITED FOR SECURITY HOLES. USE AT OWN RISK. I’M NOT RESPONSIBLE FOR YOUR FAILURE TO HEED THAT WARNING.

Example usage:

#!/bin/bash
lockdown lockedfiles.vault secret/creds.py secret/my_funcs.py
# Enter and repeat password.
# Now would be a good time to delete the files you locked,
# but make sure not to lose that vault file.

In Python:

#!/usr/bin/env python
from lockdown import Lockdown
locker = Lockdown('lockedfiles.vault')
# Enter password.
locker.unlock()

# Login with encrypted credentials. Python files aren't there!
# Note: It collapsed the path.
# (so it's locker.creds, not locker.secret.creds)
some_login(locker.creds.USERNAME, locker.creds.PASSWORD)

# Call a function.
# NOTE: These can't import vaulted files within functions.
# Files are lost after unlocking!
locker.my_funcs.scoobydoo()

# To leave files out, do this instead:
locker.unlock(delete=False)

You can see the potential uses, for example locking up a file with secret keys and credentials with a master password, or disabling functionality of a script and not exposing the source unless the password is available.

Metadata

Release files for lockdown 0.4.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 lockdown 0.4.1
File Size Uploaded Provenance Actions
lockdown-0.4.1.tar.gz 4.8 kB Without provenance Details for lockdown-0.4.1.tar.gz

Release files / lockdown-0.4.1.tar.gz

Download URL lockdown-0.4.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b92b95a637c940c3d9d04b25974519da19c6a5b60c2d82d8f80658d04a0d8f94
BLAKE2b-256 checksum
How to use checksums
be1dd31db43e5dbe998570d949655c01687d19f0fcfac2ea3c94b6144452d597
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for lockdown 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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