Skip to main content

fernet-encrypt PyPI Docker PyPiStats PyPi

A Fernet encryption CLI tool with a free, open source, remote API

Install

Use pipx to install globally in an isolated python environment.

pipx install fernet-encrypt

Usage

 Usage: fernet-encrypt [OPTIONS] COMMAND [ARGS]...

╭─ Options ───────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion          Install completion for the current shell.                     │
│ --show-completion             Show completion for the current shell, to copy it or          │
│                               customize the installation.                                   │
│ --help                        Show this message and exit.                                   │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────╮
│ login              Sign up or Login to https://fernet-encrypt.tysonholub.com                │
│ get-keys           Sync remote keys to fernet-encrypt local key storage                     │
│ create-local-key   Create a new local storage Fernet key                                    │
│ encrypt            Encrypt stdin using local key storage or remote API keys                 │
│ decrypt            Decrypt stdin using local key storage or remote API keys                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯

login

Interactively login or create a new account

$ fernet-encrypt login

Or, pass a --refresh-token to generate a new access_token without logging in (useful for automation). A refresh_token can be pulled from the .fernet-encrypt file generated by logging in (in package install location)

$ fernet-encrypt login --refresh-token=your-token

get-keys

Sync remote encryption keys to your local package

$ fernet-encrypt get-keys

Or, use --stdout to print the JSON response without syncing to your local package

$ fernet-encrypt get-keys --stdout

create-fernet-key

Create a new local key for encryption

$ fernet-encrypt create-local-key

encrypt

Encrypt stdin data using local key storage.

$ echo "some-data" | fernet-encrypt encrypt

Or, use --remote to use remote API keys to encrypt. You should pass a --name to more easily identify your keys in the web portal

$ echo "some-data" | fernet-encrypt encrypt --name "some-name" --remote

decrypt

Decrypt stdin data using local key storage.

$ cat encrypted.out | fernet-encrypt decrypt

Or, use --remote to use remote API keys to decrypt.

$ cat encrypted.out | fernet-encrypt decrypt --remote

full circle

You can redirect the output to a file or pipe it into another command

$ echo "some-data" | fernet-encrypt encrypt --name "some-name" --remote | base64 -w0 > b64.out
$ base64 -d b64.out | fernet-encrypt decrypt --remote
some-data

In the web portal you should see a filename some-name. If you upload the encryption data, you will download a file named some-name containing some-data

$ base64 -d b64.out > encrypted.out

Dev Prerequisites

  • python 3.12
  • pipx, an optional tool for prerequisite installs
  • poetry (install globally with pipx install poetry)
  • flake8 (install globally with pipx install flake8)
    • flake8-bugbear extension (install with pipx inject flake8 flake8-bugbear)
    • flake8-naming extension (install with pipx inject flake8 pep8-naming)
  • black (install globally with pipx install black)
  • pre-commit (install globally with pipx install pre-commit)
  • just, a Justfile command runner

Windows

Justfile support for Windows requires cygwin. Once installed your PATH will need to be updated to resolve cygpath.exe (probably C:\cygwin64\bin). Justfile will forward any targets with shebangs starting with / to cygwin for execution.

Consider using a bash terminal through WSL instead.

Updating python version:

  • Update python version in Dev Prerequisites above
  • Update [tool.poetry.dependencies] section of pyproject.toml
  • Update pyupgrade hook in .pre-commit-config.yaml
  • Update python version in .gitlab-ci.yml

Justfile Targets

  • install: installs poetry dependencies and pre-commit git hooks
  • update_boilerplate: fetches and applies updates from the boilerplate remote
  • test: runs pytest with test coverage report

Boilerplate

To support pulling updates from the pyplate python boilerplate, add the boilerplate git remote:

git remote add boilerplate git@gitlab.com:tysonholub/pyplate.git

Then moving forward, run just update_boilerplate to pull latest changes from the boilerplate remote. NOTE: you must keep the boilerplate remote history intact to successfully merge updates from the boilerplate remote.

Metadata

Release files for fernet-encrypt 2.0.0

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

Source distribution (sdist)

Source distribution for fernet-encrypt 2.0.0
File Size Uploaded
fernet_encrypt-2.0.0.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fernet-encrypt 2.0.0
File Interpreter ABI Platform
fernet_encrypt-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / fernet_encrypt-2.0.0.tar.gz

Download URL fernet_encrypt-2.0.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
735811f86e95ce096085e3065cfef5230241486164a917efd9e6269865cbe7b7
BLAKE2b-256 checksum
How to use checksums
452fe2ec3f41ea522a3d1c9a97907717d3c47d0e8eb9eaa56cd3a3e8783a0004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.13.2 Linux/5.15.154+

Release files / fernet_encrypt-2.0.0-py3-none-any.whl

Download URL fernet_encrypt-2.0.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5170734120dee0361aa72d942f203e3fedda55f734e6832c63cc6ebb0655151c
BLAKE2b-256 checksum
How to use checksums
d50e968e0b743308c0f7efe470d13317ca6c402a77e756eb0cd4a301241c948d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.13.2 Linux/5.15.154+
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