This commit is contained in:
parent
faca3f4446
commit
7684008ab5
3
Tupfile
3
Tupfile
|
@ -1,4 +1,5 @@
|
|||
.gitignore
|
||||
include_rules
|
||||
|
||||
: crypt.nim |> !nim |> crypt
|
||||
: crypt.nim |> !nim |> crypt
|
||||
: crack.nim |> !nim |> crack
|
|
@ -0,0 +1,28 @@
|
|||
import posix, strutils
|
||||
|
||||
{.passL: "-lcrypt".}
|
||||
|
||||
echo "What would you like to decrypt?"
|
||||
var
|
||||
line: string = readLine stdin
|
||||
salt = line[0 .. 1]
|
||||
count = 0
|
||||
|
||||
const
|
||||
chars = "1234567890qwertyuiopasdfghjklzxcvbnm"
|
||||
|
||||
for c1 in chars:
|
||||
for c2 in chars:
|
||||
for c3 in chars:
|
||||
for c4 in chars:
|
||||
for c5 in chars:
|
||||
for c6 in chars:
|
||||
for c7 in chars:
|
||||
for c8 in chars:
|
||||
var res = crypt(c1&c2&c3&c4&c5&c6&c7&c8, salt)
|
||||
if line.startsWith($res):
|
||||
echo "password: " & c1&c2&c3&c4&c5&c6&c7&c8
|
||||
echo "took " & $count & " tries"
|
||||
|
||||
quit 0
|
||||
count = count + 1
|
Loading…
Reference in New Issue