brcrypt

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package brcrypt provides useful encryption and hashing functions.

Package brcrypt provides useful encryption and hashing functions.

Package brcrypt provides useful encryption and hashing functions.

Index

Constants

View Source
const (
	AesKeyLength128 = 16
	AesKeyLength192 = 24
	AesKeyLength256 = 32
)

Constants

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(value string, key []byte) (string, error)

AesDecrypt Aes decrypt in GCM mode value with key, depending on key length determines the AES algorithm that will be used.

func AesEncrypt

func AesEncrypt(value string, key []byte) (string, error)

AesEncrypt Aes encrypt in GCM mode value with key, depending on key length determines the AES algorithm that will be used.

func AesKey128

func AesKey128() ([]byte, error)

AesKey128 Generate key for AES-128.

func AesKey192

func AesKey192() ([]byte, error)

AesKey192 Generate key for AES-192.

func AesKey256

func AesKey256() ([]byte, error)

AesKey256 Generate key for AES-256.

func BcryptHash

func BcryptHash(value string, cycles int) (string, error)

BcryptHash Bcrypt hash with defined number of cycles.

func BcryptPasswordCompare

func BcryptPasswordCompare(hashA string, hashB string) error

BcryptPasswordCompare Bcrypt hash compare.

func HashMd5

func HashMd5(value string) string

HashMd5 Hash in MD5.

func HashSha1

func HashSha1(value string) string

HashSha1 Hash in SHA1.

func HashSha256

func HashSha256(value string) string

HashSha256 Hash in SHA256.

func HashSha384

func HashSha384(value string) string

HashSha384 Hash in SHA384.

func HashSha512

func HashSha512(value string) string

HashSha512 Hash in SHA512.

func MustAesDecrypt

func MustAesDecrypt(value string, key []byte) string

MustAesDecrypt Aes decrypt in GCM mode value with key, depending on key length determines the AES algorithm that will be used. Panics on error.

func MustAesEncrypt

func MustAesEncrypt(value string, key []byte) string

MustAesEncrypt Aes encrypt in GCM mode value with key, depending on key length determines the AES algorithm that will be used. Panics on error.

func MustBcryptHash

func MustBcryptHash(value string, cycles int) string

MustBcryptHash Bcrypt hash with defined number of cycles. Panics on error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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