encrypt

package
v1.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2025 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package encrypt provides reversible AES-256-GCM encryption and decryption utilities for securing sensitive data like API keys and credentials. We are not using it anywhere yet - we will introduce encryption for all the sensitive data in one go to avoid breaking changes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext string) (string, error)

Decrypt decrypts a base64-encoded ciphertext using AES-256-GCM and returns the plaintext

func Encrypt

func Encrypt(plaintext string) (string, error)

Encrypt encrypts a plaintext string using AES-256-GCM and returns a base64-encoded ciphertext

func Init

func Init(key string, _logger schemas.Logger)

Init initializes the encryption key using Argon2id KDF to derive a secure 32-byte key from the provided passphrase. This ensures strong entropy regardless of passphrase length. The function accepts any passphrase but warns if it's too short (< 16 bytes).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL