The app was looking for lowercase keys ('signing_secret') but the encryption script was now saving uppercase keys ('SIGNING_SECRET'), causing a mismatch.
Updated all references in app.py to use uppercase key names consistently:
'signing_secret'→'SIGNING_SECRET''mongo_uri'→'MONGO_URI''gemini_api_key'→'GEMINI_API_KEY'
encrypt_secrets.py- Now saves all keys in uppercaseapp.py- All key lookups now use uppercase
Since you already ran encrypt_secrets.py with the updated code:
- Go to 🔐 Security tab
- Click 🔄 Reload Secrets
- Or restart the app and load secrets again
- Enter your passphrase
- Click 🔓 Load Secrets
After reloading secrets, you should see:
- ✅ Secrets Loaded
- In "Loaded Secrets" expander:
- ✓ GEMINI_API_KEY
- ✓ MONGO_URI
- 🔑 SIGNING_SECRET (auto-generated, 256-bit)
- ✅ Signing secret available (in Signature Verification section)
- Go to 📧 Email Analysis tab
- Scan some emails
- Go to 📚 History tab
- You should now see the stored emails with:
- Risk scores and labels
- ✅ Verified signatures
- Full analysis details
The signing secret is now stored as a hex string (e.g., "abc123def456...") and converted to bytes when needed:
signing_secret = st.session_state.secrets['SIGNING_SECRET']
if isinstance(signing_secret, str):
signing_secret = signing_secret.encode('utf-8')This is simpler than the previous hex conversion approach and works consistently across all modules.