Fix entropy calc, crack-time overflow, and CLI bugs#2
Open
Marchy02 wants to merge 1 commit into
Open
Conversation
Make charset entropy additive (lower+digit now base 36, special class always counted) in password_tester.py and script.js, kept in parity via a shared SPECIAL_CHARS set. Load common-passwords from a path built off __file__ under assets/ once into a set, degrading gracefully if missing. Compute time_to_crack in log space to avoid OverflowError on long inputs and guard base==0. Fix CLI yes/no loop to use equality and add the missing lowercase check to match the web verdict. Pin rich in requirements.txt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix da audit del codice.
Bug corretti
eliffaceva sì che, es., minuscole+cifre usassero base 10 invece di 36 e che i caratteri speciali fossero ignorati se non presenti tutte e 4 le classi. Ora additivo (+26/+26/+10/+N), in parità trapassword_tester.pyejs/script.js(costanteSPECIAL_CHARScondivisa).OverflowErrorsu password lunghe intime_to_crack: ora il calcolo è in spazio logaritmico, niente interi giganti materializzati.FileNotFoundErrorsul file delle password comuni: path costruito daPath(__file__).parent/'assets'/..., caricato una sola volta in unset, con fallback se mancante.in "Yy"(matchava qualsiasi stringa con 'y') → oraanswer.strip().lower() == 'y'.base==0(charset vuoto) per evitarepow(0,n).Extra
"veniva perso per concatenazione di literal adiacenti → ora unificato con JS (24 caratteri).requirements.txt(rich).Verifica
python3(AST + esecuzione CLI) enode --checkok; parità byte-per-byte JS/Python sui casi di test.🤖 Generated with Claude Code