crypto

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2017 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(ciphertext, key []byte) ([]byte, error)

func AESDecryptStream

func AESDecryptStream(key []byte, input io.Reader, output io.Writer) error

func AESDecryptStream2

func AESDecryptStream2(key []byte, input io.Reader, output io.Writer) error

func AESEncrypt

func AESEncrypt(plaintext, key []byte) ([]byte, error)

func AESEncryptStream

func AESEncryptStream(key []byte, input io.Reader, output io.Writer) error

func AESEncryptStream2

func AESEncryptStream2(key []byte, input io.Reader, output io.Writer) error

func DecryptByPrivateRSA

func DecryptByPrivateRSA(message []byte, privateKey, algo string) ([]byte, error)

DecryptByPrivateRSA decrypt message using Private key

func EncryptByPublicRSA

func EncryptByPublicRSA(message []byte, publicKey, algo string) ([]byte, error)

EncryptByPublicRSA encrypts using Public key and message

func Hash

func Hash(src io.Reader) ([]byte, error)

Hash hashes any io.Reader into a 20 byte hash

func HashFile

func HashFile(filename string) (string, error)

HashFile accepting a filename and convert it into secure hash value

func MakeAESKey

func MakeAESKey(size int) ([]byte, error)

MakeAESKey generates random key for aes

func NewAESDecryptWriter

func NewAESDecryptWriter(key []byte, output io.Writer) io.Writer

func NewAESEncryptWriter

func NewAESEncryptWriter(key []byte, output io.Writer) io.Writer

func PrivateKey

func PrivateKey(privateKey string) (*rsa.PrivateKey, error)

PrivateKey gets the encoded version of private key and returns a rsa.PrivateKey struct

func PublicKey

func PublicKey(publicKey string) (*rsa.PublicKey, error)

PublicKey gets the encoded version of public key and returns a rsa.PublicKey struct

func RSAKeyPair

func RSAKeyPair(size int) (string, string, error)

RSAKeyPair returns a pair of encoded string version of public/private keys

func SSHKeyPair

func SSHKeyPair(size int, pubKeyPath, privateKeyPath string) error

SSHKeyPair returns pair of public and private key in format of ssh

Types

This section is empty.

Jump to

Keyboard shortcuts

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