crypto

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package crypto provides cryptographic helpers used by stackkit for password generation, hashing, and bundle encryption.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptWithPassphrase

func DecryptWithPassphrase(ciphertext []byte, pass string) ([]byte, error)

DecryptWithPassphrase decrypts age-encrypted ciphertext using the given passphrase.

func EncryptWithPassphrase

func EncryptWithPassphrase(plaintext []byte, pass string) ([]byte, error)

EncryptWithPassphrase encrypts plaintext using age with a scrypt-passphrase recipient.

func HashPassphrase

func HashPassphrase(pass string) (string, error)

HashPassphrase returns a PHC-formatted argon2id hash of pass.

func RandomPassword

func RandomPassword(byteLen int) (string, error)

RandomPassword returns a base64-encoded random password derived from `byteLen` random bytes. byteLen must be at least 16.

func VerifyPassphrase

func VerifyPassphrase(pass, encoded string) bool

VerifyPassphrase returns true iff pass matches encoded. Constant-time comparison.

Types

This section is empty.

Jump to

Keyboard shortcuts

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