envelope

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package envelope provides PBKDF2-SHA256 + AES-256-GCM password-based encryption in a versioned JSON format compatible with the Web UI crypto.js.

Empty password is accepted and produces a valid envelope — callers that want to skip encryption should check the password before calling Seal.

Index

Constants

This section is empty.

Variables

View Source
var ErrWrongPassword = errors.New("envelope: wrong password")

ErrWrongPassword is returned by Open when decryption fails due to a bad password.

Functions

func IsEnvelope

func IsEnvelope(s string) bool

IsEnvelope reports whether s looks like a sealed envelope JSON.

func Open

func Open(envelopeJSON string, password string) ([]byte, error)

Open decrypts a JSON envelope string. Returns ErrWrongPassword when the password is incorrect (AES-GCM authentication failure).

func Seal

func Seal(plaintext []byte, password string) (string, error)

Seal encrypts plaintext with password and returns a JSON envelope string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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