encrypt

package
v1.0.1000 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESCBCDecrypt

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

AESCBCDecrypt -

func AESCBCEncrypt

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

AESCBCEncrypt -

func AESDecrypt

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

AESDecrypt - implementation for mysql AES_DECRYPT

func AESEncrypt

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

AESEncrypt - implementation for mysql AES_ENCRYPT

func AESGCMDecrypt

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

func AESGCMEncrypt

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

func BoxOpen

func BoxOpen(message, peersPublicKey, privateKey []byte) (response []byte, err error)

func BoxOpenAnonymous

func BoxOpenAnonymous(message, peersPublicKey, peerPrivateKey []byte) (response []byte, err error)

func BoxSeal

func BoxSeal(message, peersPublicKey, privateKey []byte) (response []byte, err error)

func BoxSealAnonymous

func BoxSealAnonymous(message, peersPublicKey []byte) (response []byte, err error)

func GenerateHashKeyAESGCM

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

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

func GenerateKeyAES

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

func GenerateKeyAESCBC

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

func PKcs7Pad

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

func Pkcs7UnPad

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 BoxKeyPair

type BoxKeyPair struct {
	Private *[32]byte
	Public  *[32]byte
}

func GenerateBoxKeyPair

func GenerateBoxKeyPair() (res *BoxKeyPair, err error)

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