Crate sol_safekey

Crate sol_safekey 

Source
Expand description

§Sol SafeKey

A powerful Solana key management library with military-grade encryption.

§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 sol_safekey::{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();

Structs§

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

Constants§

MAX_PASSWORD_LENGTH
Maximum password length for encryption/decryption
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 encrypted string with a 32-byte encryption key
encrypt_key
Encrypt a string with a 32-byte encryption key
generate_encryption_key_simple
Generate a 16-byte encryption key from a password using SHA-256

Type Aliases§

EncryptionResult
Result type for encryption operations