crypto

package
v2.16.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package crypto provides encryption and decryption functions for the s3proxy. It uses AES-256-GCM to encrypt and decrypt data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext, encryptedDEK []byte, kek [32]byte) ([]byte, error)

Decrypt decrypts a ciphertext using AES-256-GCM. The encrypted DEK is decrypted using the supplied KEK.

func Encrypt

func Encrypt(plaintext []byte, kek [32]byte) (ciphertext []byte, encryptedDEK []byte, err error)

Encrypt generates a random key to encrypt a plaintext using AES-256-GCM. The generated key is encrypted using the supplied key encryption key (KEK). The ciphertext and encrypted data encryption key (DEK) are returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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