encrypt

package
v0.0.0-...-3633c1a Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecryptWithCBC

func AESDecryptWithCBC(cryptStr, key []byte, iv []byte) ([]byte, error)

AESDecryptWithCBC decrypts data using AES with CBC mode.

func AESDecryptWithCFB

func AESDecryptWithCFB(cryptStr, key []byte, iv []byte) ([]byte, error)

AESDecryptWithCFB decrypts data using AES with CFB mode.

func AESDecryptWithECB

func AESDecryptWithECB(cryptStr, key []byte) ([]byte, error)

AESDecryptWithECB decrypts data using AES with ECB mode.

func AESDecryptWithOFB

func AESDecryptWithOFB(cipherStr []byte, key []byte, iv []byte) ([]byte, error)

AESDecryptWithOFB decrypts data using AES with OFB mode.

func AESEncryptWithCBC

func AESEncryptWithCBC(str, key []byte, iv []byte) ([]byte, error)

AESEncryptWithCBC encrypts data using AES with CBC mode.

func AESEncryptWithCFB

func AESEncryptWithCFB(cryptStr, key []byte, iv []byte) ([]byte, error)

AESEncryptWithCFB decrypts data using AES with CFB mode.

func AESEncryptWithECB

func AESEncryptWithECB(str, key []byte) ([]byte, error)

AESEncryptWithECB encrypts data using AES with ECB mode.

func AESEncryptWithOFB

func AESEncryptWithOFB(plainStr []byte, key []byte, iv []byte) ([]byte, error)

AESEncryptWithOFB encrypts data using AES with OFB mode.

func DeriveKeyMySQL

func DeriveKeyMySQL(key []byte, blockSize int) []byte

DeriveKeyMySQL derives the encryption key from a password in MySQL algorithm. See https://security.stackexchange.com/questions/4863/mysql-aes-encrypt-key-length.

func PKCS7Pad

func PKCS7Pad(data []byte, blockSize int) ([]byte, error)

PKCS7Pad pads data using PKCS7. See hhttp://tools.ietf.org/html/rfc2315.

func PKCS7Unpad

func PKCS7Unpad(data []byte, blockSize int) ([]byte, error)

PKCS7Unpad unpads data using PKCS7. See http://tools.ietf.org/html/rfc2315.

func SQLDecode

func SQLDecode(str string, password string) (string, error)

SQLDecode Function to handle the decode() function

func SQLEncode

func SQLEncode(cryptStr string, password string) (string, error)

SQLEncode Function to handle the encode() function

Types

This section is empty.

Jump to

Keyboard shortcuts

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