cipher

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 11 Imported by: 0

README

go-cipher

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptAES

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

DecryptAES decrypts data with AES key

func DecryptRSA

func DecryptRSA(msg []byte, pk *rsa.PrivateKey, label []byte) ([]byte, error)

DecryptRSA decrypts data with RSA private key

func ECDSAPrivateKeyFromBytes added in v0.2.0

func ECDSAPrivateKeyFromBytes(data []byte) (*ecdsa.PrivateKey, error)

ECDSAPrivateKeyFromBytes bytes to ECDSA private key

func ECDSAPrivateKeyToBytes added in v0.2.0

func ECDSAPrivateKeyToBytes(pk *ecdsa.PrivateKey) ([]byte, error)

ECDSAPrivateKeyToBytes ECDSA private key to bytes

func ECDSAPublicKeyFromBytes added in v0.2.0

func ECDSAPublicKeyFromBytes(pub []byte) (*ecdsa.PublicKey, error)

ECDSAPublicKeyFromBytes bytes to ECDSA public key

func ECDSAPublicKeyToBytes added in v0.2.0

func ECDSAPublicKeyToBytes(pub *ecdsa.PublicKey) ([]byte, error)

ECDSAPublicKeyToBytes ECDSA public key to bytes

func EncryptAES

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

EncryptAES encrypts data with AES key

func EncryptRSA

func EncryptRSA(msg []byte, pub *rsa.PublicKey, label []byte) ([]byte, error)

EncryptRSA encrypts data with RSA public key

func GenerateECDSAKeyPair added in v0.2.0

func GenerateECDSAKeyPair(c elliptic.Curve) (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)

GenerateECDSAKeyPair generates a new ECDSA key pair

func GenerateRSAKeyPair added in v0.2.0

func GenerateRSAKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)

GenerateRSAKeyPair generates a new RSA key pair

func RSAPrivateKeyFromBytes added in v0.2.0

func RSAPrivateKeyFromBytes(data []byte) (*rsa.PrivateKey, error)

RSAPrivateKeyFromBytes bytes to RSA private key

func RSAPrivateKeyToBytes added in v0.2.0

func RSAPrivateKeyToBytes(pk *rsa.PrivateKey) []byte

RSAPrivateKeyToBytes RSA private key to bytes

func RSAPublicKeyFromBytes added in v0.2.0

func RSAPublicKeyFromBytes(pub []byte) (*rsa.PublicKey, error)

RSAPublicKeyFromBytes bytes to RSA public key

func RSAPublicKeyToBytes added in v0.2.0

func RSAPublicKeyToBytes(pub *rsa.PublicKey) ([]byte, error)

RSAPublicKeyToBytes RSA public key to bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

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