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: 0

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