crypto

package
v0.0.0-...-46fa8fc Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(cipher_text []byte, key AESKey) ([]byte, error)

func AESEncrypt

func AESEncrypt(secret_message []byte, key AESKey) ([]byte, error)

func RSADecrypt

func RSADecrypt(cipher_text []byte, private *rsa.PrivateKey) (string, error)

func RSAEncrypt

func RSAEncrypt(secretmessage []byte, public_key *rsa.PublicKey) ([]byte, error)

Types

type AESKey

type AESKey []byte

func GenerateAESKey

func GenerateAESKey(bits int) (AESKey, error)

type EllipticCurve

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

func NewCurve

func NewCurve(curve elliptic.Curve) *EllipticCurve

func (*EllipticCurve) EncodeEccPrivateKey

func (ec *EllipticCurve) EncodeEccPrivateKey(privKey *ecdsa.PrivateKey) (key string, err error)

func (*EllipticCurve) EncodeEccPublicKey

func (ec *EllipticCurve) EncodeEccPublicKey(pubKey *ecdsa.PublicKey) (key string, err error)

func (*EllipticCurve) GenerateEccKeys

func (ec *EllipticCurve) GenerateEccKeys() (privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey, err error)

type Keys

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

func GenerateRSAKeys

func GenerateRSAKeys(bits int) (*Keys, error)

Jump to

Keyboard shortcuts

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