crypto_utils

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 10 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Go Crypto Utils

Utilities for random cryptographic actions in Golang

This library is built to be easy to use and compatible with Java crypto (Java Android to be specific, but the difference is almost undetectable).

To see how to use this library, look inside crypto_test.go as it shows the default way of interfacing with this library.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTextBlockSizeTooSmall    = errors.New("cipherText is too small")
	ErrTextBlockSizeNotMultiple = errors.New("ciphertext is not a multiple of the block size")
)

Functions

func AesCBCDecrypt

func AesCBCDecrypt(padding padding.Padding, encryptData, key, iv []byte) ([]byte, error)

func AesCBCEncrypt

func AesCBCEncrypt(padding padding.Padding, rawData, key, iv []byte) ([]byte, error)

func AesCTRDecrypt

func AesCTRDecrypt(padding padding.Padding, encryptData, key, iv []byte) ([]byte, error)

func AesCTREncrypt

func AesCTREncrypt(padding padding.Padding, rawData, key, iv []byte) ([]byte, error)

func AesECBDecrypt

func AesECBDecrypt(padding padding.Padding, encryptData, key []byte) ([]byte, error)

func AesECBEncrypt

func AesECBEncrypt(padding padding.Padding, rawData, key []byte) ([]byte, error)

func AesGCMDecrypt

func AesGCMDecrypt(padding padding.Padding, cipherText, key, iv, aad []byte) ([]byte, error)

func AesGCMEncrypt

func AesGCMEncrypt(padding padding.Padding, rawData, key, iv, aad []byte) ([]byte, error)

func HMACofInterfaceHash

func HMACofInterfaceHash(algo hash.Hash, key []byte, args ...[]byte) []byte

func HMACofMD5

func HMACofMD5(key []byte, args ...[]byte) []byte

func HMACofSHA1

func HMACofSHA1(key []byte, args ...[]byte) []byte

func HMACofSHA256

func HMACofSHA256(key []byte, args ...[]byte) []byte

func HMACofXXHash

func HMACofXXHash(key []byte, args ...[]byte) []byte

func InterfaceHash

func InterfaceHash(digester hash.Hash, args ...[]byte) []byte

func MD5hash

func MD5hash(args ...[]byte) []byte

func SHA1hash

func SHA1hash(args ...[]byte) []byte

func SHA256hash

func SHA256hash(args ...[]byte) []byte

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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