From 589538f9148980e995f53580f634ef54eb13f863 Mon Sep 17 00:00:00 2001 From: Philippe Partarrieu Date: Thu, 11 Mar 2021 22:32:47 +0100 Subject: [PATCH] fix lambda greedy q --- security/compute_sec_loss.ver1.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/security/compute_sec_loss.ver1.py b/security/compute_sec_loss.ver1.py index c1c5802..a806a52 100644 --- a/security/compute_sec_loss.ver1.py +++ b/security/compute_sec_loss.ver1.py @@ -163,7 +163,11 @@ def totprob(l): for tq in [10, 100, 1000]: if tq>q: continue - ball = typofixer.get_ball_union(typo_guesses[:tq]) + ball = set() + for guess in typo_guesses[:tq]: + guesses = typofixer.check(guess) + for pw in guesses: + ball.add(pw) # print "Passwords that are not queried:", set(normal_guesses[:tq]) - ball # print "New passwords that will be compromised:", ball - set(normal_guesses[:tq]) lambda_q = totprob(normal_guesses[:tq])