nip44

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeSharedSecret

func ComputeSharedSecret(pub string, sk string) ([]byte, error)

ComputeSharedSecret returns a shared secret key used to encrypt messages. The private and public keys should be hex encoded. Uses the Diffie-Hellman key exchange (ECDH) (RFC 4753).

func Decrypt

func Decrypt(payload string, key []byte) (string, error)

Decrypt decrypts a content string using the shared secret key. The inverse operation to message -> Encrypt(message, key).

func Encrypt

func Encrypt(message string, key []byte) (string, error)

Encrypt encrypts message with key using xchacha20. key should be the shared secret generated by ComputeSharedSecret. Returns: base64(1 + nonce + encrypted_bytes).

Types

This section is empty.

Jump to

Keyboard shortcuts

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