rijndael

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorPaddingBadMultple    = errors.New(common.FormatNamespaceString("Bad PKCS#7 padding - bad multiple"))
	ErrorPaddingNotAMultiple  = errors.New(common.FormatNamespaceString("Bad PKCS#7 padding - not a multiple of blocksize"))
	ErrorPaddingTooLong       = errors.New(common.FormatNamespaceString("Bad PKCS#7 padding - too long"))
	ErrorPaddingTooShort      = errors.New(common.FormatNamespaceString("Bad PKCS#7 padding - too short"))
	ErrorPaddingNotAllTheSame = errors.New(common.FormatNamespaceString("Bad PKCS#7 padding - not all the same"))
)

Errors padding & unpadding can return

Functions

func AESECBPKCSDecrypt

func AESECBPKCSDecrypt(key, crypted []byte) ([]byte, error)

AESECBPKCSDecrypt AES/ECB/PKCSPadding Decrypt

func AESECBPKCSEncrypt

func AESECBPKCSEncrypt(key, source []byte) ([]byte, error)

AESECBPKCSEncrypt AES/ECB/PKCSPadding Encrypt

func NewECBDecrypter

func NewECBDecrypter(key []byte) (cipher.BlockMode, error)

NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.

func NewECBEncrypter

func NewECBEncrypter(key []byte) (cipher.BlockMode, error)

NewECBEncrypter returns a BlockMode which encrypts in electronic code book key, using the given AES key.

func PKCS5Padding

func PKCS5Padding(buf []byte) ([]byte, error)

PKCS5Padding PKCS#5: buf using PKCS#7 to a multiple of 8.

func PKCS5UnPadding

func PKCS5UnPadding(buf []byte) ([]byte, error)

PKCS5UnPadding buf using PKCS#7 from a multiple of 8 returning a slice of

func PKCSPadding

func PKCSPadding(buf []byte, n int) ([]byte, error)

PKCSPadding buf using PKCS#7 to a multiple of n.

func PKCSUnPadding

func PKCSUnPadding(buf []byte, n int) ([]byte, error)

PKCSUnPadding buf using PKCS#7 to a multiple of n.

Types

This section is empty.

Jump to

Keyboard shortcuts

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