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
Signertrait declares operations that all digital signature providers must support. It is the primary interface by which signers are specified inTransactionsigning 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§
- Encryption
Result - Result type for encryption operations