Documentation ¶
Overview ¶
Package encryption bundles various symmetric and asymmetric encryption schemes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AES ¶
type AES struct{}
AES is the AES-CBC object handler.
type Asymmetric ¶
type Asymmetric interface { // Generate creates a public/private key pair. Generate(seed []byte) (pk, sk []byte, err error) // Encrypt enciphers a message with a given public key. Encrypt(pk, msg, ad []byte) ([]byte, error) // Decrypt deciphers a message with a given private key. Decrypt(sk, ct, ad []byte) ([]byte, error) }
Asymmetric defines a common interface for asymmetric encryption schemes.
type Authenticated ¶
type Authenticated interface { // Encrypt enciphers and authenticates a message and authenticates the associated data. Encrypt(key, msg, ad []byte) ([]byte, error) // Decrypt deciphers and authenticates a ciphertext with associated data. Decrypt(key, ct, ad []byte) ([]byte, error) }
Authenticated defines a common interface for authenticated encryption schemes.
type ECIES ¶
type ECIES struct {
// contains filtered or unexported fields
}
ECIES implements the Elliptic Curve Integrated Encryption Scheme on a given curve using HS256 and AES-GCM as the authentication and encryption primitives and HDKF for key derivation.
type Encapsulation ¶
type Encapsulation interface { // Generate creates a public/private key pair. Generate(seed []byte) (pk, sk []byte, err error) // Encapsulate generates and encapsulates a fresh symmetric key. Encapsulate(pk []byte) (k, c []byte, err error) // Decapsulate decapsulates a symmetric key from a ciphertext. Decapsulate(sk, ct []byte) ([]byte, error) }
Encapsulation defines a common interface for key-encapsulation mechanisms.
type GCM ¶
type GCM struct{}
GCM implements the AES-GCM AEAD scheme.
type OAEP ¶
type OAEP struct{}
OAEP implements to RSA-OAEP encryption scheme based on SHA256.
func (OAEP) Decrypt ¶
Decrypt deciphers a ciphertext and associated data with the given private key.
type Symmetric ¶
type Symmetric interface { // Generate returns a fresh symmetric key. Generate(seed []byte) ([]byte, error) // Encrypt enciphers a message with a given symmetric key. Encrypt(key, msg []byte) ([]byte, error) // Decrypt deciphers a ciphertext with a given symmetric key. Decrypt(key, ct []byte) ([]byte, error) }
Symmetric defines a common interface for symmetric encryption schemes.