crypto

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESCBCDecrypt

func AESCBCDecrypt(c, key []byte) ([]byte, error)

AESCBCDecrypt decrypts cipher text with AES algorithm in CBC mode. Note that key length must be 16, 24 or 32 bytes to select AES-128, AES-192, or AES-256. Note that AES block size is 16 bytes.

func AESCBCEncrypt

func AESCBCEncrypt(p, key []byte) ([]byte, error)

AESCBCEncrypt encrypts data with AES algorithm in CBC mode Note that key length must be 16, 24 or 32 bytes to select AES-128, AES-192, or AES-256 Note that AES block size is 16 bytes.

func Base64AESCBCDecrypt

func Base64AESCBCDecrypt(c string, key []byte) ([]byte, error)

Base64AESCBCDecrypt decrypts cipher text encoded by base64 with AES algorithm in CBC mode.

func Base64AESCBCEncrypt

func Base64AESCBCEncrypt(p, key []byte) (string, error)

Base64AESCBCEncrypt encrypts data with AES algorithm in CBC mode and then encode using base64.

func PKCS7Padding

func PKCS7Padding(p []byte, blockSize int) []byte

PKCS7Padding fills plaintext as an integral multiple of the block length.

func PKCS7UnPadding

func PKCS7UnPadding(p []byte) ([]byte, error)

PKCS7UnPadding removes padding data from the tail of plaintext.

Types

This section is empty.

Jump to

Keyboard shortcuts

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