mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-06 09:52:06 +02:00
Cut over to new decryption lib version and provide channel crack streaming updates
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import { GroupTextCracker, type ProgressReport } from 'meshcore-hashtag-cracker';
|
||||
import { ENGLISH_WORDLIST } from 'meshcore-hashtag-cracker/wordlist';
|
||||
import NoSleep from 'nosleep.js';
|
||||
import type { RawPacket, Channel } from '../types';
|
||||
import { api } from '../api';
|
||||
@@ -59,10 +60,9 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
const noSleep = new NoSleep();
|
||||
noSleepRef.current = noSleep;
|
||||
|
||||
// Load wordlist
|
||||
cracker.loadWordlist('/words_alpha.txt')
|
||||
.then(() => setWordlistLoaded(true))
|
||||
.catch((err) => console.error('Failed to load wordlist:', err));
|
||||
// Use built-in wordlist
|
||||
cracker.setWordlist(ENGLISH_WORDLIST);
|
||||
setWordlistLoaded(true);
|
||||
|
||||
return () => {
|
||||
cracker.destroy();
|
||||
@@ -387,9 +387,11 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
/>
|
||||
Decrypt historical
|
||||
</label>
|
||||
{decryptHistorical && undecryptedPacketCount !== null && undecryptedPacketCount > 0 && (
|
||||
{decryptHistorical && (
|
||||
<span className="text-xs text-muted-foreground">
|
||||
(may take a while for {undecryptedPacketCount.toLocaleString()} packets)
|
||||
{undecryptedPacketCount !== null && undecryptedPacketCount > 0
|
||||
? `(${undecryptedPacketCount.toLocaleString()} packets; messages stream in as decrypted)`
|
||||
: '(messages stream in as decrypted)'}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -220,18 +220,25 @@ export function NewMessageModal({
|
||||
</Tabs>
|
||||
|
||||
{showHistoricalOption && (
|
||||
<div className="flex items-center justify-end space-x-2">
|
||||
<Label
|
||||
htmlFor="try-historical"
|
||||
className="text-sm text-muted-foreground cursor-pointer"
|
||||
>
|
||||
Try decrypting {undecryptedCount.toLocaleString()} stored packet{undecryptedCount !== 1 ? 's' : ''}
|
||||
</Label>
|
||||
<Checkbox
|
||||
id="try-historical"
|
||||
checked={tryHistorical}
|
||||
onCheckedChange={(checked) => setTryHistorical(checked === true)}
|
||||
/>
|
||||
<div className="space-y-1">
|
||||
<div className="flex items-center justify-end space-x-2">
|
||||
<Label
|
||||
htmlFor="try-historical"
|
||||
className="text-sm text-muted-foreground cursor-pointer"
|
||||
>
|
||||
Try decrypting {undecryptedCount.toLocaleString()} stored packet{undecryptedCount !== 1 ? 's' : ''}
|
||||
</Label>
|
||||
<Checkbox
|
||||
id="try-historical"
|
||||
checked={tryHistorical}
|
||||
onCheckedChange={(checked) => setTryHistorical(checked === true)}
|
||||
/>
|
||||
</div>
|
||||
{tryHistorical && (
|
||||
<p className="text-xs text-muted-foreground text-right">
|
||||
Messages will stream in as they decrypt in the background
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user