chg: prng detection now takes in consideration if detection fails.

This commit is contained in:
iceman1001 2018-02-20 21:20:17 +01:00
commit 4e915d2eb4
5 changed files with 21 additions and 14 deletions

View file

@ -111,10 +111,12 @@ end
-- performs a test if tag nonce uses weak or hardend prng
local function perform_prng_test()
local isweak = core.detect_prng()
if isweak then
if isweak == 1 then
dbg('PRNG detection : WEAK nonce detected')
else
elseif isweak == 0 then
dbg('PRNG detection : HARDEND nonce detected')
else
dbg('PRNG detection : failed')
end
return isweak
end
@ -149,7 +151,7 @@ local function main(args)
seen_uids[uid] = uid
-- check if PRNG is WEAK
if perform_prng_test() then
if perform_prng_test() == 1 then
print("Card found, commencing crack on UID", uid)
if #key == 12 then