encryption

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package encryption provides encryption modules for oplog.Encryption.

Simple is compatible with @orbitdb/simple-encryption: a password is stretched with PBKDF2-SHA256 (32767 iterations, 16-byte random salt) into an AES-128-GCM key, and each ciphertext is salt || nonce || sealed data. Databases encrypted by either implementation can be read by the other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Simple

type Simple struct {
	// contains filtered or unexported fields
}

Simple encrypts with a key derived from a password. It implements oplog.Encrypter and is safe for concurrent use.

func NewSimple

func NewSimple(password []byte) (*Simple, error)

NewSimple returns an encrypter for password.

func (*Simple) Decrypt

func (s *Simple) Decrypt(_ context.Context, data []byte) ([]byte, error)

Decrypt implements oplog.Encrypter.

func (*Simple) Encrypt

func (s *Simple) Encrypt(_ context.Context, plaintext []byte) ([]byte, error)

Encrypt implements oplog.Encrypter. Each call uses a fresh random nonce.

Jump to

Keyboard shortcuts

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