crypto

package
v0.0.0-...-3f3ae68 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PwdKey = []byte("123451231")

Functions

func AesDecrypt

func AesDecrypt(data []byte, key []byte) ([]byte, error)

func AesEncrypt

func AesEncrypt(data []byte, key []byte) ([]byte, error)

func DecryptByAes

func DecryptByAes(data string) ([]byte, error)

func DecryptByinv

func DecryptByinv(key, iv []byte, ciphertext string) (string, error)

func EncryptByAes

func EncryptByAes(data []byte) (string, error)

func EncryptByinv

func EncryptByinv(key, iv []byte, plaintext string) (string, error)

func NaclDecrypt

func NaclDecrypt(box []byte, nonce [24]byte, secret [32]byte) ([]byte, error)

NaclDecrypt ... note: use pointers???

func NaclEncrypt

func NaclEncrypt(message []byte, nonce [24]byte, secret [32]byte) ([]byte, error)

NaclEncrypt ... note: use pointers???

func NewBlake2b256Sig

func NewBlake2b256Sig(key, data []byte) ([]byte, error)

NewBlake2b256Sig ...

func NewBlake2b512Sig

func NewBlake2b512Sig(key, data []byte) ([]byte, error)

NewBlake2b512Sig ...

func NewNaclKeyPair

func NewNaclKeyPair() ([32]byte, [64]byte, error)

NewNaclKeyPair ...

func NewNaclKeyPairFromSeed

func NewNaclKeyPairFromSeed(seed []byte) ([32]byte, [64]byte, error)

NewNaclKeyPairFromSeed ... note: return pointers???

func NewXXHash

func NewXXHash(data []byte, bitLength int64) []byte

NewXXHash ...

func NewXXHash128

func NewXXHash128(data []byte) [16]byte

NewXXHash128 ...

func NewXXHash256

func NewXXHash256(data []byte) [32]byte

NewXXHash256 ...

func NewXXHash64

func NewXXHash64(data []byte) [8]byte

NewXXHash64 ...

Types

type Blake2b256Hash

type Blake2b256Hash [blake2b.Size256]uint8

Blake2b256Hash ...

func NewBlake2b256

func NewBlake2b256(data []byte) *Blake2b256Hash

NewBlake2b256 ...

type Blake2b512Hash

type Blake2b512Hash [blake2b.Size]uint8

Blake2b512Hash ...

func NewBlake2b512

func NewBlake2b512(data []byte) *Blake2b512Hash

NewBlake2b512 ...

type Hash

type Hash [sha256.Size]uint8

Hash ...

func NewSHA256

func NewSHA256(data []byte) *Hash

NewSHA256 ...

type Rsa

type Rsa struct {
	// contains filtered or unexported fields
}

func NewRsa

func NewRsa(publicKey, privateKey string) *Rsa

func (*Rsa) CreateKeys

func (r *Rsa) CreateKeys(keyLength int) (privateKey, publicKey string)

func (*Rsa) CreatePkcs8Keys

func (r *Rsa) CreatePkcs8Keys(keyLength int) (privateKey, publicKey string)

func (*Rsa) Decrypt

func (r *Rsa) Decrypt(data []byte) ([]byte, error)

func (*Rsa) Encrypt

func (r *Rsa) Encrypt(data []byte) ([]byte, error)

func (*Rsa) Pkcs1ToPkcs8

func (r *Rsa) Pkcs1ToPkcs8(key []byte) []byte

func (*Rsa) Sign

func (r *Rsa) Sign(data []byte, sHash crypto.Hash) ([]byte, error)

func (*Rsa) Verify

func (r *Rsa) Verify(data []byte, sign []byte, sHash crypto.Hash) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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