cryptox

package
v0.0.0-...-0e6b806 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESCBCDecrypt

func AESCBCDecrypt(cipherKey, ciphertext []byte, useBase64 ...bool) ([]byte, error)

AESCBCDecrypt hex decodes a piece of data and then decrypts it using CBC mode. The cipherKey argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.

func AESCBCEncrypt

func AESCBCEncrypt(cipherKey, plainText []byte, useBase64 ...bool) []byte

AESCBCEncrypt uses CBC mode to encrypt a piece of data and then encodes it in hex. The cipherKey argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.

func AESCTRDecrypt

func AESCTRDecrypt(cipherKey, ciphertext []byte, useBase64 ...bool) ([]byte, error)

AESCTRDecrypt hex decodes a piece of data and then decrypts it using CTR mode. The cipherKey argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.

func AESCTREncrypt

func AESCTREncrypt(cipherKey, plainText []byte, useBase64 ...bool) []byte

AESCTREncrypt uses CTR mode to encrypt a piece of data and then encodes it in hex. The cipherKey argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.

func AESDecrypt

func AESDecrypt(cipherKey, ciphertext []byte, useBase64 ...bool) ([]byte, error)

AESDecrypt hex decodes a piece of data and then decrypts it using ECB mode. The cipherKey argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.

func AESEncrypt

func AESEncrypt(cipherKey, plainText []byte, useBase64 ...bool) []byte

AESEncrypt uses ECB mode to encrypt a piece of data and then encodes it in hex. The cipherKey argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.

func Fnv1aToUint32

func Fnv1aToUint32(b []byte) uint32

Fnv1aToUint32 returns the 32-bit FNV-1a hash sum of b.

func Fnv1aToUint64

func Fnv1aToUint64(b []byte) uint64

Fnv1aToUint64 returns the 64-bit FNV-1a hash sum of b.

func Md5

func Md5(b []byte) string

Md5 returns the MD5 checksum string of the data.

func Sha1

func Sha1(b []byte) string

Sha1 returns the sha1 checksum string of the data.

func Sha256

func Sha256(b []byte) string

Sha256 returns the sha256 checksum string of the data.

func Sha512

func Sha512(b []byte) string

Sha512 returns the sha512 checksum string of the data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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