secretkeys

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package secretkeys implements the encryption logic for secretKeys feature

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(
	encryptedText string,
) (string, error)

Decrypt decrypts AES encrypted value back to text

func Encrypt

func Encrypt(
	text string,
) (string, error)

Encrypt calculates AES encrypted value for given text with configured master encryption key Due to random nonce the function is not idempotent

func GenerateEncryptionKey

func GenerateEncryptionKey() string

GenerateEncryptionKey generates 32-byte encryption key For AES encryption 32-byte key selects AES-256 mode

func ValidateEncryptionKey

func ValidateEncryptionKey(
	encryptionKey string,
) error

ValidateEncryptionKey check if encryption key has size of 16, 24 or 32 bytes Otherwise it cannot be used as encryption key for AES

Types

This section is empty.

Jump to

Keyboard shortcuts

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