envelope

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MPL-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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