Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

An un-audited security tool to encrypt Python code.

Project Description

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.

Release History

Release History

This version
History Node

0.4.0

History Node

0.3.1

History Node

0.3.0

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.5

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
lockdown-0.4.0.tar.gz (4.8 kB) Copy SHA256 Checksum SHA256 Source Nov 19, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting