Documentation Index
Fetch the complete documentation index at: https://docs.poge.dev/llms.txt
Use this file to discover all available pages before exploring further.
Encryption Architecture
Poge uses AES-256-GCM (Advanced Encryption Standard with Galois/Counter Mode) for encrypting all sensitive data. This is the same encryption standard used by banks, government agencies, and enterprise applications.Encryption Algorithm Details
- Algorithm: AES-256-GCM
- Key Length: 256 bits (32 bytes)
- IV Length: 12 bytes (96 bits)
- Salt Length: 16 bytes (128 bits)
- Key Derivation: PBKDF2 with SHA-256
- KDF Iterations: 100,000
- Authentication: Built-in with GCM mode
AES-256-GCM provides both confidentiality (encryption) and authenticity (tamper detection). Any modification to encrypted data will be detected during decryption.
Key Derivation from PIN
Your 6-digit PIN is never stored directly. Instead, Poge uses PBKDF2 (Password-Based Key Derivation Function 2) to derive strong encryption keys from your PIN.Derivation Process
Why PBKDF2 with 100,000 Iterations?
- Slows down brute force attacks: Each PIN attempt takes significant computational time
- Unique keys from the same PIN: Different salts produce different keys
- Industry standard: PBKDF2 is approved by NIST and widely used
Encryption Process
When data is encrypted, the following steps occur:Step 1: Generate Random Salt and IV
- Random 16-byte salt: Ensures the same PIN generates different keys each time
- Random 12-byte IV: Prevents pattern analysis across encrypted messages
Step 2: Derive Encryption Key
The PIN and salt are used to derive a 256-bit AES key via PBKDF2.Step 3: Encrypt Data
Step 4: Store Encrypted Data
The encrypted data is stored as a base64-encoded string in localStorage.Decryption Process
Decryption reverses the encryption process:Decryption Failure Scenarios
- Wrong PIN: Key derivation produces incorrect key → decryption fails
- Corrupted data: GCM authentication tag verification fails
- Modified data: GCM detects tampering → decryption fails
AES-GCM’s built-in authentication ensures that any tampering with encrypted data is detected. If decryption succeeds, you can be confident the data hasn’t been modified.
PIN Hashing and Verification
Your PIN is never stored in plain text. Instead, a SHA-256 hash is stored for verification.PIN Hash Generation
PIN Verification
Encrypted Data Format
LocalStorage Encrypted Data Structure
Each piece of encrypted data in localStorage follows this format:Encrypted Backup Files (.enc)
When you export your data (Settings → Data Management → Export All Data), Poge creates an.enc file with the following structure:
Backup File Format
Export Process
Fromcomponents/settings.tsx:131-188:
Import Process
Fromcomponents/settings.tsx:190-286:
Encryption Strength Analysis
Computational Complexity
To brute-force a 6-digit PIN protected by PBKDF2 with 100,000 iterations:- Possible PINs: 1,000,000 (000000 to 999999)
- Time per attempt (approximate): ~50ms on modern hardware
- Total brute-force time: 1,000,000 × 50ms = 50,000 seconds ≈ 13.9 hours
- 5-attempt lockout: After 5 failed attempts, the app locks for 5 minutes
- Lockout effectively makes brute-force impractical in the application
Offline Brute-Force Resistance
If an attacker extracts encrypted data from localStorage:- They still need to brute-force the PIN
- Each attempt requires 100,000 PBKDF2 iterations
- Even with powerful hardware, this is computationally expensive
- Recommended mitigation: Use strong backup passwords (not just 6-digit PINs)
For maximum security when exporting backups, use a long, random password (16+ characters) instead of a 6-digit PIN. This makes the backup file resistant to offline brute-force attacks.
Security Considerations
Web Crypto API Trust
Poge relies on the browser’s Web Crypto API implementation:- Standardized: W3C Web Cryptography API specification
- Hardware-accelerated: Uses native crypto libraries when available
- Audited: Browser implementations are regularly audited
- Cross-browser: Consistent across Chrome, Firefox, Safari, Edge
Memory Security
Encryption keys exist in memory only during encryption/decryption operations:- Keys are generated on-demand from PIN + salt
- Keys are not stored in localStorage
- Keys are automatically garbage-collected after use
- JavaScript’s memory is not protected from memory dumps (OS-level attack)
Side-Channel Attack Resistance
Poge uses constant-time comparison for PIN verification to prevent timing attacks:Compliance and Standards
Poge’s encryption implementation follows industry standards:- NIST SP 800-38D: AES-GCM mode specification
- NIST SP 800-132: PBKDF2 recommendations (>100,000 iterations)
- RFC 5084: AES-GCM algorithm identifiers
- FIPS 197: AES specification
While Poge uses strong encryption, it is a client-side tool designed for developer convenience, not a certified enterprise secrets management system. For regulated industries, consult your security team about acceptable use cases.
Best Practices for Developers
If you’re extending or auditing Poge’s encryption:- Never reduce iteration count: 100,000 iterations is the minimum recommended by NIST
- Always use crypto.getRandomValues(): Never use Math.random() for cryptographic operations
- Validate GCM auth tags: Don’t ignore decryption failures
- Clear sensitive data: Zero out buffers containing plaintext after encryption
- Audit dependencies: Review any npm packages that touch encryption code
Next Steps
- Learn about session management and PIN protection
- Review security best practices
- Understand the threat model