crypto

package
v0.0.0-...-aab1a1c Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptData

func DecryptData(cryptoJSON CryptoJSON, password string) ([]byte, error)

DecryptData расшифровывает данные с использованием пароля

func PubkeyToAddress

func PubkeyToAddress(pubKey ecdsa.PublicKey) string

Types

type CipherParams

type CipherParams struct {
	IV string `json:"iv"`
}

CipherParams содержит параметры шифрования

type CryptoJSON

type CryptoJSON struct {
	Cipher       string       `json:"cipher"`
	CipherCode   string       `json:"ciphercode"` // Переименовано из CipherText
	CipherParams CipherParams `json:"cipherparams"`
	KDF          string       `json:"kdf"`
	KDFParams    KDFParams    `json:"kdfparams"`
	MAC          string       `json:"mac"`
}

CryptoJSON хранит зашифрованные данные и параметры

func EncryptData

func EncryptData(data []byte, password string) (*CryptoJSON, error)

EncryptData шифрует данные с использованием пароля

type KDFParams

type KDFParams struct {
	DKLen int    `json:"dklen"`
	N     int    `json:"n"`
	P     int    `json:"p"`
	R     int    `json:"r"`
	Salt  string `json:"salt"`
}

KDFParams содержит параметры KDF-функции

Jump to

Keyboard shortcuts

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