Skip to main content

Python CLI to share secret files via github with symmetric encryption ed25519.

Project description

symmetric-secret-share

Python CLI to share secret files via github with symmetric encryption ed25519.

  • IMPORTANT: The secret files should be git-ignored to avoid oblivious leakage.
  • Temporarily supports only text files (only tested with .env).
  • Best used to store/share secrets and configurations.
  • Key should be a 32-byte long string, meanly, 32 ASCII, 16 two-byte UTF-8 or 8 four-byte UTF-8 characters.
  • (FAQ) If you share with GitHub (like the example), please notice that there's a 5 minutes cool-down on refreshing. Detail However, GitHub Gist seems doesn't have this cool-down limitation.

Use

  1. Install CLI: pip3 install symmetric-secret-share.
  2. Check the Tutorial Chapter and sss --help.
  3. Recommended: set up a global key chain with sss key, or you would have to input a key every time.
  4. Get a config like $REPO_ROOT/tests/injection/sss.json. The JSON-schema in $schema of this file will help you write the config file.

inject

  1. Get a config file like $REPO_ROOT/tests/injection/sss.json.

  2. Run CLI

    sss inject [-k TEXT] CONFIG_PATH
    

share

  1. Run CLI

    sss share [-k TEXT] CONFIG_PATH
    

key

  1. Run CLI

    sss key [-c/f/g] # -g: generate one key, -c: clear key chain, -f: force
    
  2. Upload the generated file to GitHub (or other platforms).

  3. Update the config file if needed.

Security

  • There are 256**32==1,15e+77 keys of 32 of ASCII (one-byte utf-8 string).
  • To generate ASCII key, you can use sss key --generate.
  • To generate two-byte utf-8 string, a possibility is to use onlineutf8tools

Contribute

Tutorial

In this tutorial, all commands are assumed to be run under the $REPO_ROOT. We are going to use these concepts and variables:

  • key chain: A file to share key, initialized with sss key.
  • key: This key contains 32 characters..
  • URL: https://raw.githubusercontent.com/PabloLION/symmetric-secret-share/main/tests/example.encrypted.

We are going to play with the folder test/injection, with the sss.json file inside it. To share your own file, a new config file should be created.

Setup a local key chain

sss key # create/edit
sss key -c # clear all keys

load files from URL

These code will generate a test/injection/target.env like test/example.env

sss inject ./tests/injection/sss.json # use key from initial key chain
sss inject -k "This key contains 32 characters." ./tests/injection/sss.json
sss inject ./tests/injection/sss.json -k "I'm a string with 32 characters." # fail

share files

Need to upload manually #TODO These code will generate a test/injection/target.encrypted

sss share ./tests/injection/sss.json # use key from initial key chain
sss share -k "This key contains 32 characters." ./tests/injection/sss.json

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

ymmetric-secret-share-0.0.8.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ymmetric_secret_share-0.0.8-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file ymmetric-secret-share-0.0.8.tar.gz.

File metadata

  • Download URL: ymmetric-secret-share-0.0.8.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for ymmetric-secret-share-0.0.8.tar.gz
Algorithm Hash digest
SHA256 f063ae0bc0f04ba69cda7768f9ee32a3277044600f1ee813aa683d44e76e5bc6
MD5 8c8b9773669f0d6072f85584b333cb0e
BLAKE2b-256 0d92bc6f59e803bc41a7871dc42ada3cbaf23c8137b54622eb14c486b8394211

See more details on using hashes here.

File details

Details for the file ymmetric_secret_share-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: ymmetric_secret_share-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for ymmetric_secret_share-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8ef4b61711b03be95d9507d4a9456c2f758f16fcc1fdaa7d43c20e0dda09f7cb
MD5 b3802dc8c2deb930626240a7f170bbe4
BLAKE2b-256 381755e3a67cce70e99dbbe65c8d71ee63f8402abaf2b9fc40553e90f3b9ba28

See more details on using hashes here.

Supported by

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