aes_gcm

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package aes_gcm provides encryption and decryption functions using AES-GCM.

Index

Constants

View Source
const AES_GCM_AuthTagSize = 16

AES_GCM_AuthTagSize is the size of the authentication tag in AES-GCM. It is set to 16 bytes, which provides strong integrity protection.

View Source
const AES_GCM_NonceSize = 12

AES_GCM_NonceSize is the size of the nonce used in AES-GCM encryption. It is set to 12 bytes as recommended for AES-GCM.

Variables

View Source
var (
	ErrDuplicatedNonceUsed = errors.New("duplicate nonce used for AES/GCM decryption")
)

Functions

func Decrypt_AES_GCM

func Decrypt_AES_GCM(ciphertext []byte, key []byte) ([]byte, error)

Decrypt_AES_GCM decrypts the ciphertext using AES-GCM with the provided key. It returns the plaintext and any error encountered.

func Encrypt_AES_GCM

func Encrypt_AES_GCM(plaintext []byte, key []byte) ([]byte, error)

Encrypt_AES_GCM encrypts the plaintext using AES-GCM with the provided key. It returns the ciphertext (nonce + encrypted data) and any error encountered.

func IsAESPasswordSupported

func IsAESPasswordSupported(password string) bool

IsAESPasswordSupported checks if the given password is suitable for AES encryption. It returns true if the password length is 16, 24, or 32 bytes (128, 192, or 256 bits), which are the supported key sizes 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