crypto

package
v0.0.0-...-f4d0149 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const EncryptBufferSize = 4096 * 130

Variables

This section is empty.

Functions

func DecryptData

func DecryptData(aesKey, hmacKey []byte, cipheredData, cipheredAuth []byte, index int) ([]byte, error)

func DecryptKey

func DecryptKey(priv *rsa.PrivateKey, encKey string) ([]byte, []byte, error)

func DecryptName

func DecryptName(aesKey, hmacKey []byte, nameEnc string) (string, error)

func DecryptPrivateKey

func DecryptPrivateKey(encPriv, pass string) (*rsa.PrivateKey, error)

func DecryptRandom

func DecryptRandom(aesKey, cipheredAuth []byte) []byte

func Encrypt

func Encrypt(rnd io.Reader, aesKey, hmacKey []byte, input io.Reader, size int) io.Reader

func EncryptBlock

func EncryptBlock(rnd io.Reader, aesKey, hmacKey, plain []byte, index int) ([]byte, []byte, error)

func EncryptKey

func EncryptKey(pub *rsa.PublicKey, aesKey, hmacKey []byte) (string, error)

func EncryptName

func EncryptName(aesKey, hmacKey []byte, name string) (string, error)

func EncryptPrivateKey

func EncryptPrivateKey(priv *rsa.PrivateKey, pass string) (string, error)

func EncryptSector

func EncryptSector(rnd io.Reader, aesKey, hmacKey, plain []byte, index int) ([]byte, []byte, error)

func GenerateKey

func GenerateKey(rnd io.Reader) ([]byte, []byte, error)

func NewECBDecrypter

func NewECBDecrypter(b cipher.Block) cipher.BlockMode

func NewECBEncrypter

func NewECBEncrypter(b cipher.Block) cipher.BlockMode

func SHA1

func SHA1(input string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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