Documentation
¶
Overview ¶
Package cryptoutil provides utility functions for cryptographic operations.
Index ¶
- func DecryptSymmetric(encryptedMsg []byte, secretKey *[32]byte) ([]byte, error)
- func EncryptSymmetric(msg []byte, secretKey *[32]byte) ([]byte, error)
- func Sha256Hash(msg []byte) []byte
- func SignSymmetric(msg []byte, secretKey *[32]byte) ([]byte, error)
- func VerifyAndReadAssymetric(signedMsg []byte, publicKey *[32]byte) ([]byte, error)
- func VerifyAndReadAssymetricBase64(signedMsg Base64, publicKey Base64) ([]byte, error)
- func VerifyAndReadSymmetric(signedMsg []byte, secretKey *[32]byte) ([]byte, error)
- type Base64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptSymmetric ¶ added in v0.0.64
DecryptSymmetric decrypts a message using a symmetric key. It is a convenience wrapper around the nacl/secretbox package.
func EncryptSymmetric ¶ added in v0.0.64
EncryptSymmetric encrypts a message using a symmetric key. It is a convenience wrapper around the nacl/secretbox package.
func Sha256Hash ¶ added in v0.0.60
Sha256Hash returns the SHA-256 hash of a message as a byte slice.
func SignSymmetric ¶ added in v0.0.12
SignSymmetric signs a message using a symmetric key. It is a convenience wrapper around the nacl/auth package.
func VerifyAndReadAssymetric ¶ added in v0.0.20
VerifyAndReadAssymetric verifies a signed message using a public key and returns the original message. It is a convenience wrapper around the nacl/sign package.
func VerifyAndReadAssymetricBase64 ¶ added in v0.0.57
VerifyAndReadAssymetricBase64 verifies a signed message using a base64 encoded public key and returns the original message. It is a convenience wrapper around the nacl/sign package.