crypto

package
v0.0.0-...-f96b470 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package crypto provides encryption and decryption functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashSHA512

func HashSHA512(s string) string

HashSHA512 Returns the SHA512 hash of a string.

func NewAPIKey

func NewAPIKey() (string, error)

NewAPIKey generates a new api key using crypto rand package.

Types

type AESCipher

type AESCipher interface {
	Encrypt(plaintext string) (string, error)
	Decrypt(ciphertext string) (string, error)
}

AESCipher is an interface for AES encryption and decryption.

func NewAESCipher

func NewAESCipher(secretKey string) AESCipher

NewAESCipher creates a new AESCipher.

Jump to

Keyboard shortcuts

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