crypto

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: AGPL-3.0 Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

CheckPasswordHash is a function to compare provided password with the hashed password

func DecryptJSON

func DecryptJSON(ciphertext []byte) (interface{}, error)

DecryptJSON decrypts JSON serializable data using AES encryption algorithm with Galois Counter Mode

func DecryptPlain

func DecryptPlain(ciphertext []byte) ([]byte, error)

DecryptPlain decrypts ciphertext using AES encryption algorithm with Galois Counter Mode

func EncryptJSON

func EncryptJSON(data interface{}) ([]byte, error)

EncryptJSON encrypts JSON serializable data using AES encryption algorithm with Galois Counter Mode

func EncryptOrderRecipient

func EncryptOrderRecipient(recipient *ent.PaymentOrderRecipient) (string, error)

EncryptOrderRecipient encrypts the recipient details using the aggregator's public key

func EncryptPlain

func EncryptPlain(plaintext []byte) ([]byte, error)

EncryptPlain encrypts plaintext using AES encryption algorithm with Galois Counter Mode

func GenerateAccountFromIndex

func GenerateAccountFromIndex(accountIndex int) (*common.Address, *ecdsa.PrivateKey, error)

GenerateAccountFromIndex generates a crypto wallet account from HD wallet mnemonic

func GenerateTronAccountFromIndex

func GenerateTronAccountFromIndex(accountIndex int) (wallet *tronWallet.TronWallet, err error)

GenerateTronAccountFromIndex generates a Tron wallet account from HD wallet mnemonic

func GetOrderRecipientFromMessageHash

func GetOrderRecipientFromMessageHash(messageHash string) (*types.PaymentOrderRecipient, error)

GetOrderRecipientFromMessageHash decrypts the message hash and returns the order recipient

func PublicKeyDecryptJSON

func PublicKeyDecryptJSON(ciphertext []byte, privateKeyPEM string) (interface{}, error)

PublicKeyDecryptJSON decrypts JSON serializable data using RSA 2048 encryption algorithm

func PublicKeyDecryptPlain

func PublicKeyDecryptPlain(ciphertext []byte, privateKeyPEM string) ([]byte, error)

PublicKeyDecryptPlain decrypts ciphertext using RSA 2048 encryption algorithm

func PublicKeyEncryptJSON

func PublicKeyEncryptJSON(data interface{}, publicKeyPEM string) ([]byte, error)

PublicKeyEncryptJSON encrypts JSON serializable data using RSA 2048 encryption algorithm

func PublicKeyEncryptPlain

func PublicKeyEncryptPlain(plaintext []byte, publicKeyPEM string) ([]byte, error)

PublicKeyEncryptPlain encrypts plaintext using RSA 2048 encryption algorithm

Types

This section is empty.

Jump to

Keyboard shortcuts

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