Skip to main content

SecondGuard API & Encryption Library

Project description

Getting Started

This library makes rate-limited encryption really simple!

Ask SecondGuard for a key to encrypt the secret locally, and then encrypt the secret for storage in the database of your choice:

>>> from secondguard import sg_encrypt_secret
>>> to_save_in_db = sg_encrypt_secret('Attack at dawn!', 'YOUR_SEED_PUB_HASH', 'YOUR API_TOKEN')
>>> print(to_save_in_db)

When you want to decrypt that data in the future, you’ll ask SecondGuard for the original key to decrypt:

>>> from secondguard import sg_decrypt_secret
>>> sg_decrypt_secret(to_save_in_db, 'YOUR_API_TOKEN')
'Attack at dawn!'

You can also decrypt locally using your private seed. To verify this is working as designed, turn off your internet connection(or audit the code path) and then run:

>>> from secondguard import sg_decrypt_from_priv_seed
>>> sg_decrypt_from_priv_seed(to_save_in_db, 'YOUR_PRIVATE_SEED')
'Attack at dawn!'

See for examples for all methods. Feel free to audit the code to confirm that all encryption is taking place locally and SecondGuard never sees your plaintext or ciphertext.


To get started:

$ pip install secondguard

If you don’t have pip pre-installed on your machine you can install pip here. If for some reason pip doesn’t work you can use easy_install, but you really shouldn’t do that.

Note that if you use an outdated version of pip you may get a scary InsecurePlatformWarning warning installing any package (including secondguard). As always, you should upgrade your pip to the latest version before installing any new software:

$ pip install --upgrade pip

Advanced users can download the source code and build from source:

$ python build
$ python install

You can also use python3 (replace pip3 with pip).

Project details

Download files

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

Files for secondguard, version 1.1.10
Filename, size File type Python version Upload date Hashes
Filename, size secondguard-1.1.10.tar.gz (6.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page