crypto

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombineKeys added in v0.21.1

func CombineKeys(privateKey, publicKey, aesSeed string) string

CombineKeys takes a private key, a public key, and an AES seed, and combines them into a single string, separating each with a newline.

Parameters: - privateKey: The X25519 private key as a string. - publicKey: The X25519 public key as a string. - aesSeed: The AES seed for symmetric encryption as a string.

Returns:

  • A single string containing the private key, public key, and AES seed, each separated by a newline.

func GenerateKeys added in v0.21.1

func GenerateKeys() (string, string, string, error)

GenerateKeys generates a pair of X25519 keys for public key encryption using the age library, as well as an AES seed for symmetric encryption.

Returns: - publicKey: The X25519 public key as a string. - privateKey: The X25519 private key as a string. - aesSeed: A generated AES seed for symmetric encryption. - error: An error object if any step in the process fails.

func RandomString

func RandomString(n int) (string, error)

RandomString generates a cryptographically-unique secure random string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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