wallet

package
v0.0.0-...-4904f9a Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext string, key []byte) (string, error)

Decrypt decrypts data using AES-256-GCM Format matches Dart: "iv:encrypted" (both base64 encoded) Supports both 12-byte (standard GCM) and 16-byte IVs (Dart default)

func DecryptWallet

func DecryptWallet(appDir, password string) (map[string]interface{}, error)

DecryptWallet decrypts wallet.json using the provided password Returns the decrypted wallet data as a map

func DeriveKey

func DeriveKey(password string, salt []byte, iterations int) []byte

DeriveKey derives an encryption key from a password using PBKDF2-HMAC-SHA256 This matches the Dart implementation exactly

func IsWalletEncrypted

func IsWalletEncrypted(appDir string) bool

IsWalletEncrypted checks if the wallet is encrypted

func LoadUnencryptedWallet

func LoadUnencryptedWallet(appDir string) (map[string]interface{}, error)

LoadUnencryptedWallet loads wallet.json when it's not encrypted

Types

type EncryptionMetadata

type EncryptionMetadata struct {
	Salt       string `json:"salt"`
	Iterations int    `json:"iterations"`
	Encrypted  bool   `json:"encrypted"`
	Version    string `json:"version"`
}

EncryptionMetadata stores encryption parameters

func LoadMetadata

func LoadMetadata(appDir string) (*EncryptionMetadata, error)

LoadMetadata reads wallet_encryption.json

Jump to

Keyboard shortcuts

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