Documentation
¶
Index ¶
- func Decrypt(ciphertext, key []byte) (plaintext []byte, err error)
- func DecryptAsymmetric(ciphertext, privateKey []byte) (plaintext []byte, err error)
- func Encrypt(plaintext, key []byte) (ciphertext []byte, err error)
- func EncryptAsymmetric(plaintext, publicKey []byte) (ciphertext []byte, err error)
- func GenerateKeyPair() (publicKey []byte, privateKey []byte, err error)
- func Sign(message, privateKey []byte) (signature []byte, err error)
- func Verify(message, signature, publicKey []byte) (ok bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶ added in v0.0.19
Decrypt performs symmetric decryption of ciphertext using AES-GCM with a 32-byte key.
func DecryptAsymmetric ¶ added in v0.0.19
DecryptAsymmetric decrypts ciphertext with a private key.
func Encrypt ¶ added in v0.0.19
Encrypt performs symmetric encryption of plaintext using AES-GCM with a 32-byte key. It returns the ciphertext, which includes the nonce and the encrypted data.
func EncryptAsymmetric ¶ added in v0.0.19
EncryptAsymmetric encrypts plaintext for a given public key using ECIES (ECDH + AES-GCM). The returned ciphertext includes the ephemeral public key needed for decryption.
func GenerateKeyPair ¶ added in v0.0.19
GenerateKeyPair generates a new ECDSA key pair for asymmetric cryptography using the P-256 curve.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.