aes

package module
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 7 Imported by: 1

README

aes

Package for both encrypt and decrypt data using AES algorithm written in Go

Installation

Use go get command:

go get -u github.com/colduction/aes

TODO

  • CMAC
  • GCM-SIV
  • SIV
  • PCBC

Modes

  • CBC
  • CFB
  • CTR
  • ECB
  • GCM
  • OFB

Padding styles

  • ANSI X9.23
  • Bit padding
  • ISO/IEC 7816-4
  • ISO 10126
  • PKCS#5
  • PKCS#7
  • Zero padding

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CBC cbc // CBC (Cipher Block Chaining): Encrypts each block of plaintext with XOR chaining to the previous ciphertext block.
	CFB cfb // CFB (Cipher Feedback): Encrypts an IV and XORs it with plaintext segments, turning AES into a self-synchronizing stream cipher.
	CTR ctr // CTR (Counter): Encrypts a counter value and XORs it with plaintext, effectively turning AES into a stream cipher.
	ECB ecb // ECB (Electronic Codebook): Encrypts each block of plaintext independently.
	GCM gcm // GCM (Galois/Counter Mode): Combines CTR mode encryption with Galois mode for authentication, providing confidentiality and integrity.
	OFB ofb // OFB (Output Feedback): Encrypts an IV to create a keystream, XORed with plaintext to produce ciphertext, making AES a stream cipher.
)

Functions

func GenerateRandomBytes

func GenerateRandomBytes(size int) ([]byte, error)

func IvSizeEquality

func IvSizeEquality(length, blocksize int) (err error)

func ValidBlockSize

func ValidBlockSize(length int) error

func ValidCiphertext added in v1.10.0

func ValidCiphertext(length, blocksize int) error

func ValidIvSize

func ValidIvSize(length int) error

func ValidKeySize

func ValidKeySize(length int) error

Types

type BlockSizeError

type BlockSizeError int

func (BlockSizeError) Error

func (i BlockSizeError) Error() string

type EmptyDataError

type EmptyDataError int

type GCMDataSizeError

type GCMDataSizeError int

func (GCMDataSizeError) Error

func (i GCMDataSizeError) Error() string

type GCMStdNonceSizeError

type GCMStdNonceSizeError int

func (GCMStdNonceSizeError) Error

func (i GCMStdNonceSizeError) Error() string

type GCMTagSizeError

type GCMTagSizeError int

func (GCMTagSizeError) Error

func (i GCMTagSizeError) Error() string

type InvalidCiphertextError added in v1.10.0

type InvalidCiphertextError int

func (InvalidCiphertextError) Error added in v1.10.0

func (i InvalidCiphertextError) Error() string

type InvalidDataError

type InvalidDataError int

func (InvalidDataError) Error

func (i InvalidDataError) Error() string

type IvSizeEqualityError

type IvSizeEqualityError int

func (IvSizeEqualityError) Error

func (i IvSizeEqualityError) Error() string

type IvSizeError

type IvSizeError int

func (IvSizeError) Error

func (i IvSizeError) Error() string

type KeySizeError

type KeySizeError int

func (KeySizeError) Error

func (k KeySizeError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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