encrypt

package
v1.1.91 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESCBCDecrypt added in v1.1.4

func AESCBCDecrypt(encrypted []byte, key []byte) (decrypted []byte, err error)

AESCBCDecrypt -

func AESCBCEncrypt added in v1.1.4

func AESCBCEncrypt(src []byte, key []byte, iv []byte) (encrypted []byte, err error)

AESCBCEncrypt -

func AESDecrypt added in v1.1.3

func AESDecrypt(encrypted []byte, key []byte) (decrypted []byte, err error)

AESDecrypt - implementation for mysql AES_DECRYPT

func AESEncrypt added in v1.1.3

func AESEncrypt(src []byte, key []byte) (encrypted []byte, err error)

AESEncrypt - implementation for mysql AES_ENCRYPT

func AESGCMDecrypt added in v1.1.9

func AESGCMDecrypt(key []byte, plaintextBytes []byte) (plainText []byte, err error)

func AESGCMEncrypt added in v1.1.9

func AESGCMEncrypt(key []byte, plaintextBytes []byte) (ciphertext []byte, err error)

func GenerateHashKeyAESGCM added in v1.1.9

func GenerateHashKeyAESGCM(key []byte, ln int) (genKey []byte)

GenerateHashKeyAESGCM - Generate an encryption key. 16 bytes = AES-128, 32 bytes = AES-256.

func GenerateKeyAES added in v1.1.3

func GenerateKeyAES(key []byte) (genKey []byte)

func GenerateKeyAESCBC added in v1.1.4

func GenerateKeyAESCBC(key []byte) (genKey []byte)

func PKcs7Pad added in v1.1.5

func PKcs7Pad(buf []byte, size int) ([]byte, error)

func Pkcs7UnPad added in v1.1.9

func Pkcs7UnPad(padded []byte, size int) ([]byte, error)

func SealBoxDecrypted

func SealBoxDecrypted(k string, data []byte) (res []byte, err error)

func SealBoxEncrypted

func SealBoxEncrypted(k string, data []byte) (res []byte, err error)

Types

type RsaPemPrivateKey

type RsaPemPrivateKey struct {
	Private []byte
	Public  []byte
}

func GenerateRsaKeyPem

func GenerateRsaKeyPem(bitSize int) (res *RsaPemPrivateKey, err error)

Jump to

Keyboard shortcuts

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