Skip to main content

A CLI to manipulate fernet encrypted secrets

Project description

Fernet CLI

A CLI to manage Fernet encrypted env variables

Commands

generate

$> fernet generate
ixfFROV_uIYZsM4cB6mCs4Bi7mnlsDzOqk-WCsLsYiA=

This command generates a new fernet key (using Fernet.generate_key()) and prints it out. Use this command to generate news keys to be securely stored.

init

$> export FERNET_KEY='ixfFROV_uIYZsM4cB6mCs4Bi7mnlsDzOqk-WCsLsYiA='
$> export FERNET__VARIABLE_NAME='Z0FBQUFBQmlLTF9QZ3FuZjZxVllmTmJtcDhpU3p2MHAxdVpWTXlVa21jLU5PbEdoeFE0d01TR1R3QnZORGMyVlFXX1ZISG0tUFl3RnVXVmFWNlhVRG9ZWTFjWEQzRm9wQmJCTXhFdTZkZ0F4S2ZmZjg0RGhTdE09'
$> eval $(fernet init)
$> echo $VARIABLE_NAME
some-secret-value

This command will attempt to decrypt any env variables prefixed with FERNET__ using the key provided in the FERNET_KEY env variable. It then ouptuts a shell eval-able definition of decrypted variables, typically to be used as eval $(fernet init).

encrypt

$> export FERNET_KEY='ixfFROV_uIYZsM4cB6mCs4Bi7mnlsDzOqk-WCsLsYiA='
$> fernet encrypt 'some-secret-value'
Z0FBQUFBQmlLTF9QZ3FuZjZxVllmTmJtcDhpU3p2MHAxdVpWTXlVa21jLU5PbEdoeFE0d01TR1R3QnZORGMyVlFXX1ZISG0tUFl3RnVXVmFWNlhVRG9ZWTFjWEQzRm9wQmJCTXhFdTZkZ0F4S2ZmZjg0RGhTdE09

This command encrypts the passed argument using the fernet key provided in the FERNET_KEY env variable and prints it out.

decrypt

$> export FERNET_KEY='ixfFROV_uIYZsM4cB6mCs4Bi7mnlsDzOqk-WCsLsYiA='
$> fernet decrypt 'Z0FBQUFBQmlLTF9QZ3FuZjZxVllmTmJtcDhpU3p2MHAxdVpWTXlVa21jLU5PbEdoeFE0d01TR1R3QnZORGMyVlFXX1ZISG0tUFl3RnVXVmFWNlhVRG9ZWTFjWEQzRm9wQmJCTXhFdTZkZ0F4S2ZmZjg0RGhTdE09'
some-secret-value

This command dencrypt the passed argument using the fernet key provided in the FERNET_KEY env variable and prints it out.

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

fernet_cli-0.0.4.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

fernet_cli-0.0.4-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file fernet_cli-0.0.4.tar.gz.

File metadata

  • Download URL: fernet_cli-0.0.4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fernet_cli-0.0.4.tar.gz
Algorithm Hash digest
SHA256 4ddbc4cbd20d9416e0713dae6cb9ca73c255188fa4136e82b694171f0a12c4bd
MD5 4701743fee6aea7bde59221956f9a3f5
BLAKE2b-256 7ce99db40eec4bb54d72e887ec2914bf963e8998f64b88f30dbdeabdd67f060f

See more details on using hashes here.

File details

Details for the file fernet_cli-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: fernet_cli-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fernet_cli-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5bee5a5e17f913d971fc0cd962713b004a54f61ce00a7a46acc182128de6d409
MD5 da237c43261ca685444fa17121abb7de
BLAKE2b-256 ca436c4b9fc7c7eefac33ad6a39feaf730d8532fa2ba000227a0028e972763fd

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