mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-07 09:57:50 +08:00
feat: Implement Krux KEF encryption compatibility
This commit is contained in:
48
src/App.tsx
48
src/App.tsx
@@ -73,8 +73,7 @@ function App() {
|
||||
|
||||
// Krux integration state
|
||||
const [encryptionMode, setEncryptionMode] = useState<'pgp' | 'krux' | 'seedqr'>('pgp');
|
||||
const [kruxLabel, setKruxLabel] = useState('Seed Backup');
|
||||
const [kruxIterations, setKruxIterations] = useState(200000);
|
||||
|
||||
const [seedQrFormat, setSeedQrFormat] = useState<'standard' | 'compact'>('standard');
|
||||
const [detectedMode, setDetectedMode] = useState<EncryptionMode | null>(null);
|
||||
|
||||
@@ -284,8 +283,6 @@ function App() {
|
||||
publicKeyArmored: publicKeyInput || undefined,
|
||||
messagePassword: backupMessagePassword || undefined,
|
||||
mode: encryptionMode,
|
||||
kruxLabel: encryptionMode === 'krux' ? kruxLabel : undefined,
|
||||
kruxIterations: encryptionMode === 'krux' ? kruxIterations : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -604,39 +601,9 @@ function App() {
|
||||
{/* Krux-specific fields */}
|
||||
{encryptionMode === 'krux' && activeTab === 'backup' && (
|
||||
<>
|
||||
<div className="space-y-2 pt-2">
|
||||
<label className="text-xs font-bold text-slate-700 uppercase tracking-wider">Krux Label</label>
|
||||
<div className="relative">
|
||||
<input
|
||||
type="text"
|
||||
className={`w-full pl-3 pr-4 py-2.5 bg-white border border-slate-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-teal-500 transition-all ${isReadOnly ? 'blur-sm select-none' : ''
|
||||
}`}
|
||||
placeholder="e.g., My Seed 2026"
|
||||
value={kruxLabel}
|
||||
onChange={(e) => setKruxLabel(e.target.value)}
|
||||
readOnly={isReadOnly}
|
||||
/>
|
||||
</div>
|
||||
<p className="text-[10px] text-slate-800 mt-1">Label for identification (max 252 bytes)</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<label className="text-xs font-bold text-slate-700 uppercase tracking-wider">PBKDF2 Iterations</label>
|
||||
<div className="relative">
|
||||
<input
|
||||
type="number"
|
||||
className={`w-full pl-3 pr-4 py-2.5 bg-white border border-slate-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-teal-500 transition-all ${isReadOnly ? 'blur-sm select-none' : ''
|
||||
}`}
|
||||
placeholder="e.g., 200000"
|
||||
value={kruxIterations}
|
||||
onChange={(e) => setKruxIterations(Number(e.target.value))}
|
||||
min={10000}
|
||||
step={10000}
|
||||
readOnly={isReadOnly}
|
||||
/>
|
||||
</div>
|
||||
<p className="text-[10px] text-slate-800 mt-1">Higher = more secure but slower (default: 200,000)</p>
|
||||
</div>
|
||||
|
||||
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -660,6 +627,15 @@ function App() {
|
||||
: 'Symmetric encryption password (SKESK)'}
|
||||
</p>
|
||||
</div>
|
||||
<div className="pt-3 border-t border-slate-300">
|
||||
<div className="flex items-start gap-2 text-xs text-slate-600">
|
||||
<Info size={14} className="shrink-0 mt-0.5" />
|
||||
<p>
|
||||
<strong>Krux Compatible Mode:</strong><br />
|
||||
Uses wallet fingerprint as salt and 100,000 iterations (Krux defaults).
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{activeTab === 'backup' && (
|
||||
|
||||
Reference in New Issue
Block a user