ciphers

package
v0.0.0-...-489cf7a Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptLargeString

func DecryptLargeString(key *rsa.PrivateKey, chunks []string) ([]byte, error)

func DecryptLargeStringWithEd25519

func DecryptLargeStringWithEd25519(key ed25519.PrivateKey, chunks []string) ([]byte, error)

DecryptLargeStringWithEd25519 decrypts data encrypted with ed25519 hybrid encryption

func DecryptWithPrivateRSAKey

func DecryptWithPrivateRSAKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)

DecryptWithPrivateRSAKey decrypts data with private key

func EncryptLargeString

func EncryptLargeString(key crypto.PublicKey, s string) ([]string, error)

func EncryptWithPublicRSAKey

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

EncryptWithPublicRSAKey encrypts data with public key

func GenerateEd25519KeyPair

func GenerateEd25519KeyPair() (ed25519.PrivateKey, ed25519.PublicKey, error)

GenerateEd25519KeyPair generates a new ed25519 key pair

func GenerateKeyPair

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

GenerateKeyPair generates a new RSA key pair

func MarshalEd25519PrivateKey

func MarshalEd25519PrivateKey(priv ed25519.PrivateKey) (string, error)

MarshalEd25519PrivateKey marshals an ed25519 private key to PEM format

func MarshalEd25519PublicKey

func MarshalEd25519PublicKey(pub ed25519.PublicKey) ([]byte, error)

MarshalEd25519PublicKey marshals an ed25519 public key to SSH authorized key format

func MarshalPublicKey

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

func MarshalRSAPrivateKey

func MarshalRSAPrivateKey(priv *rsa.PrivateKey) string

func ParsePublicKey

func ParsePublicKey(s string) (crypto.PublicKey, error)

func PrivateKeyToBytes

func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte

PrivateKeyToBytes private key to bytes

func PublicKeyToBytes

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

PublicKeyToBytes 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