dek

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 15 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 dek registers the "dek" encryption provider. Byte-slice encryption uses AES-256-GCM; streamed attachment encryption uses MSEH v3 AES-GCM records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESGCMOpenWithAAD added in v0.0.4

func AESGCMOpenWithAAD(key, iv, ciphertext, aad []byte) ([]byte, error)

AESGCMOpenWithAAD decrypts ciphertext using key, iv, and AAD.

func AESGCMSealWithNonceAndAAD added in v0.0.4

func AESGCMSealWithNonceAndAAD(key, iv, plaintext, aad []byte) (usedIV, ciphertext []byte, err error)

AESGCMSealWithNonceAndAAD encrypts plaintext with AES-256-GCM using the supplied IV and AAD.

func NewGCMNonce added in v0.0.4

func NewGCMNonce() ([]byte, error)

NewGCMNonce returns a fresh AES-GCM nonce.

func NewGCMStreamDecryptReader added in v0.0.4

func NewGCMStreamDecryptReader(src io.Reader, key []byte, providerID string, headerNonce []byte) (io.Reader, error)

NewGCMStreamDecryptReader returns a Reader over plaintext from an MSEH v3 authenticated record stream.

func NewGCMStreamEncryptWriter added in v0.0.4

func NewGCMStreamEncryptWriter(dst io.Writer, key []byte, providerID string, headerNonce []byte) (io.WriteCloser, error)

NewGCMStreamEncryptWriter returns a WriteCloser that writes MSEH v3 authenticated 64-KiB AES-GCM records to dst.

func NewGCMStreamNonce added in v0.0.4

func NewGCMStreamNonce(key []byte) ([]byte, error)

NewGCMStreamNonce generates a v3 attachment stream nonce. The leading bytes encode a stable key ID so rotated providers can select the correct master key before streaming; the trailing bytes are the per-stream salt.

func SelectGCMStreamKey added in v0.0.4

func SelectGCMStreamKey(keys [][]byte, nonce []byte) ([]byte, error)

SelectGCMStreamKey chooses the master key encoded into a v3 stream nonce.

Types

This section is empty.

Jump to

Keyboard shortcuts

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