HomeGuidesAPI ReferenceChangelog
Log In
Guides

Encrypt/Decrypt

Encrypt/Decrypt CLI

This CLI module will allow you to encrypt and decrypt .csv, .json, .txt, or .yaml files with a passkey.

  • encrypt - Encrypt a .csv, .json, .txt, or .yaml file with a passkey
    • --file - the file you would like to encrypt
  • decrypt - Decrypt a .csv, .json, .txt, or .yaml file with a passkey
    • --file - the file you would like to decrypt
  • change_passkey - Change your encryption/decryption passkey

The purpose of this CLI command is to provide the ability to encrypt sensitive files used by the CLI so no passwords, keys, or other security significant information is stored in clear text. The CLI command is most commonly used to provide encryption for the init.yaml file which contains secrets which are used to orchestrate the CLI. The encryption prevents the keys from being stolen should anyone gain access to the server/container where the CLI is running. It is highly recommended that all secret files leverage the CLI encryption to protect sensitive data.

Example Commands

You can set up your passkey with your first ever encrypt command, or use the change-passkey command.

  • regscale change_passkey

Encrypt your init.yaml file.

  • regscale encrypt --file init.yaml

Decrypt queries.csv file in the data directory.

  • regscale decrypt --file data/queries.csv

Encrypted init.yaml Example

The following init.yaml shows you a before and after being encrypted:

Before

domain: https://mycompany.regscale.com
token: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.eyJzdWIiOiJhYmVsYXJkbyJ9
maxThreads: 1000
userId: e8c8aa2e-c66f-49fb-a373-00c89b45c90d

After

gAAAAABjdplaamGSjuT_zu-rlPG8jX3nvSteJ4t4eN9a1TLxYNB4JIc7NipLZGY2Yq1qzXqt-lYITmhDJdwEP4ipDVs-GkGwSQqOdBJOBMNxrovDcyl3ipSIuIBTaAShp6qIEPnJq03A7scsk7ewXdm-uqQG7CfqNKXrqJGw3CrmtTWji_cwq2Q-tH4GeUp6gtTB8vT66IZQZEHONsIivDoWH92WZ_f_YhGprRJEo1EyyfYG6P44xu35AE8UohKUe5LjSkBeb2AmbbnjtBNqvxrrdXVndC9Bum8R1sImrQuLsNxfHTj5PY76RI4h_PGxsK9F6_JeeO_qSqvJOwwEc8mb-lE4qgyEQnS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