Ravindra BagaleCourses & study guides मराठी

Chapter 94: HashiCorp Vault and Secrets Management

DevOps

94.13 Transit — encryption as a service, not a data store

Story (fictional teaching scenario). At a fictional Mysuru shop, Emma from Bristol wants the app to store ciphertext without holding the encryption key itself.

Transit — encryption as a service, not a data store
Transit — encryption as a service, not a data store

Why

A separate encryption operation can reduce key exposure, but any caller allowed to decrypt can still see plaintext.

What

  • Transit engine performs cryptographic operations with keys managed in Vault.
  • Plaintext is the input before encryption; ciphertext is encrypted output.
  • Base64 is an encoding used for API transport, not encryption.
  • Transit does not store application payloads as a KV database; applications store returned ciphertext themselves.
  • Key rotation creates a new key version. Existing ciphertext needs retained compatible key versions or an approved migration.

How

  1. Separate encrypt-only and decrypt privileges where needed.

  2. Send only the intended payload through a protected connection.

  3. Store returned ciphertext in the application’s chosen store.

  4. Test rotation/restore without destroying old key material.

Example 1: Request and response shape

  1. Read the command or request.
{"plaintext":"REVNT19PTkxZ"}
  1. Read the result.

Output (illustrative; NOT executed against Vault)

{"data":{"ciphertext":"vault:v1:ILLUSTRATIVE_NOT_VALID"}}
  1. Line by line: The plaintext field is base64 for the harmless text DEMO_ONLY. A transit encrypt endpoint such as /v1/transit/encrypt/training-key would use a configured key. The sample ciphertext is invalid placeholder text, not real encryption output. No crypto operation or key creation was run.

Example 2: Do not confuse encoding and encryption

  1. Read the command or request.
import base64
print(base64.b64decode("REVNT19PTkxZ").decode())
  1. Read the result.

Output (illustrative; NOT executed against Vault)

DEMO_ONLY
  1. Line by line: Anyone can reverse base64 without a key. This standard-library decoding is not a Vault integration. A decrypt permission deserves the same care as reading a secret.

Ravindra Bagale's Tip

Base64 hides nothing. Encryption needs protected keys and permissions.

Did you understand? Let us try it once more.