Skip to main content

Crate fnzero_safe

Crate fnzero_safe 

Source
Expand description

§FnzSafe

A Solana key management library with authenticated password keystores.

§Features

  • Simple Encryption: Password-based encryption for Solana private keys
  • Triple-Factor Authentication: Hardware fingerprint + master password + security question
  • 2FA Support: TOTP-based two-factor authentication
  • Cross-Platform: Works on macOS, Linux, and Windows

§Quick Start

use fnzero_safe::{KeyManager, EncryptionResult};

// Generate a new Solana keypair
let keypair = KeyManager::generate_keypair();

// Encrypt with password
let encrypted = KeyManager::encrypt_with_password(
    &keypair.to_base58_string(),
    "my_strong_password"
).unwrap();

// Decrypt with password
let decrypted = KeyManager::decrypt_with_password(
    &encrypted,
    "my_strong_password"
).unwrap();

Modules§

bot_helper
Bot Helper Module
interactive
Interactive Menu Module
operations
Solana Operations Interactive Menu

Structs§

KeyManager
Main interface for key management operations
Keypair
A vanilla Ed25519 key pair
Pubkey
The address of a Solana account.

Enums§

KeystoreVersion

Constants§

KEYSTORE_V2_VERSION
KEYSTORE_V3_VERSION
MAX_KEYSTORE_JSON_BYTES
MAX_PASSWORD_LENGTH
Maximum password size accepted by v2 operations, measured in UTF-8 bytes.
MIN_PASSWORD_LENGTH
Minimum password length for encryption/decryption

Traits§

Signer
The Signer trait declares operations that all digital signature providers must support. It is the primary interface by which signers are specified in Transaction signing interfaces

Functions§

decrypt_key
Decrypt a base64-encoded legacy encrypted string with a 32-byte key.
decrypt_key_to_bytes
Decrypt to raw bytes (used when plaintext may be base58 string or 64-byte keypair).
encrypt_key
Encrypt a string with the legacy unauthenticated format.
generate_encryption_key_simple
Derive the legacy v1 key. New password keystores use Argon2id instead.

Type Aliases§

EncryptionResult
Result type for encryption operations