Kryptex (kryptex v0.1.0)

Copy Markdown View Source

Public API for encrypting/decrypting field payloads.

This package ports the same core mechanism from the Phoenix Ecto encryption example:

  • AES-256-GCM
  • random IV on every write
  • key id embedded in ciphertext for key rotation
  • encryption wired into Ecto.ParameterizedType

Summary

Functions

decrypt(ciphertext)

@spec decrypt(binary()) :: {:ok, binary()} | {:error, term()}

encrypt(plaintext)

@spec encrypt(binary()) :: {:ok, binary()} | {:error, term()}