encryption

package
v1.32.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomIVKey

func GenerateRandomIVKey(blockSize int) (bIv string, err error)

GenerateRandomIVKey generate random IV value

Types

type AESCryptor

type AESCryptor struct {
	// contains filtered or unexported fields
}

AESCryptor aes cryptor

func NewAESCryptor

func NewAESCryptor(key string, iv string, blockSize int) *AESCryptor

NewAESCryptor create new AESCryptor. The key will be hashed using sha256 and will be used as the private key

func (*AESCryptor) Decrypt

func (c *AESCryptor) Decrypt(cipherText string) (plainText string, err error)

Decrypt decrypt cipherText using CBC

func (*AESCryptor) Encrypt

func (c *AESCryptor) Encrypt(plainText string) (encryptedText string, err error)

Encrypt encrypt plain text using CBC

Jump to

Keyboard shortcuts

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