encryption

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildTimeRSAPublicKey string

Functions

func CreatePublicKeyFromKeyBytes

func CreatePublicKeyFromKeyBytes(keyBytes []byte) (*rsa.PublicKey, error)

CreatePublicKeyFromKeyBytes creates an RSA PublicKey structure from public key bytes

func CreateSymmetricKey

func CreateSymmetricKey(length int) ([]byte, error)

CreateSymmetricKey creates a cryptographically secure random key of the specified length

func EncryptAsymmetric

func EncryptAsymmetric(key *rsa.PublicKey, plaintext []byte) ([]byte, error)

EncryptAsymmetric does RSA-OAEP with SHA-256

func EncryptSymmetric

func EncryptSymmetric(in io.Reader, out io.Writer, key []byte) error

EncryptSymmetric uses AES-CRT with HMAC inside using single key for both

Types

This section is empty.

Jump to

Keyboard shortcuts

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