Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pass Checker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tetras-libre
Pass Checker
Commits
f987fefb
Unverified
Commit
f987fefb
authored
8 years ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Small fixes
parent
075acc80
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test_pass.py
+26
-22
26 additions, 22 deletions
src/test_pass.py
with
26 additions
and
22 deletions
src/test_pass.py
+
26
−
22
View file @
f987fefb
...
...
@@ -32,9 +32,7 @@ def add_dictionnaries():
for
fn
in
os
.
listdir
(
directory
):
fn
=
directory
+
"
/
"
+
fn
if
os
.
path
.
isfile
(
fn
):
print
(
fn
)
name
=
os
.
path
.
basename
(
os
.
path
.
splitext
(
fn
)[
0
])
print
(
name
)
with
open
(
fn
)
as
f
:
dicts
[
name
]
=
f
.
read
().
splitlines
()
add_frequency_lists
(
dicts
)
...
...
@@ -47,9 +45,10 @@ def test_pass(password, inputs):
results
=
zxcvbn
(
password
,
inputs
)
lines
=
[]
lines
.
append
(
"
Résultats du test
:
\n
"
)
lines
.
append
(
"
Résultats du test
\n
"
)
lines
.
append
(
"
Nombre de tentatives : {}
"
.
format
(
results
[
"
guesses
"
]))
# TODO let tr handle things
times
=
results
[
"
crack_times_display
"
]
lines
.
append
(
"
Temps requis pour craquer votre mot de passe
"
)
lines
.
append
(
"
\t
Dump bases de donnée mal protégée :
\t
**{}**
"
.
format
(
...
...
@@ -63,9 +62,7 @@ def test_pass(password, inputs):
lines
.
append
(
"
\n
"
)
lines
.
append
(
"
Methode de hack utilisées
"
)
if
results
[
"
sequence
"
]
==
[]:
lines
.
append
(
"
\t
Votre mot de passe n
'
a été trouvé dans aucun dictionnaire
"
)
else
:
# Print hack methods
for
seq
in
results
[
"
sequence
"
]:
if
seq
[
"
pattern
"
]
==
"
bruteforce
"
:
lines
.
append
(
"
\t
Mot de passe trouvé par force brute
"
)
...
...
@@ -86,9 +83,16 @@ def test_pass(password, inputs):
lines
.
append
(
"
Score Global {}/4 : {}
"
.
format
(
results
[
"
score
"
],
valeur
[
results
[
"
score
"
]]))
for
key
,
values
in
results
[
"
feedback
"
].
items
():
lines
.
append
(
"
{} :
"
.
format
(
tr
(
key
)))
# Tel that we sould add the key line if there are some contents
needappend
=
True
if
not
isinstance
(
values
,
list
):
# Simplify things by always using lists
values
=
[
values
]
for
val
in
values
:
if
val
!=
""
:
if
needappend
:
# Append key line
lines
.
append
(
"
{} :
"
.
format
(
tr
(
key
)))
needappend
=
False
lines
.
append
(
"
\t
{}
"
.
format
(
tr
(
val
)))
return
lines
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment