crypto

package
v0.0.0-...-68f985e Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertextHex string, key []byte) (string, error)

Decrypt decrypts a value encrypted with Encrypt

func DeriveKey

func DeriveKey(password string, salt []byte) []byte

DeriveKey takes a password and a salt and produces a 32-byte master key

func DeriveTransportKey

func DeriveTransportKey(apiKey string) []byte

DeriveTransportKey derives a 32-byte AES key from the API key This key is used to encrypt values in transit

func Encrypt

func Encrypt(plaintext string, key []byte) (string, error)

Encrypt encrypts a plaintext value with AES-GCM

func GenerateSalt

func GenerateSalt() ([]byte, error)

GenerateSalt generates a random 16-byte salt

func KeyToHex

func KeyToHex(key []byte) string

KeyToHex converts the master key to a hexadecimal string which is the format SQLCipher expects

Types

This section is empty.

Jump to

Keyboard shortcuts

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