From c351a529516c7d12001d776d9764372d6fd82f3e Mon Sep 17 00:00:00 2001 From: Mari Wahl Date: Mon, 13 Oct 2014 19:22:13 -0400 Subject: [PATCH] some small fixes --- .../2014-ASIS-CTF/crypto_paillier/binary_search.py | 11 ++++++----- README.md | 4 +--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CTFs_and_WarGames/2014-ASIS-CTF/crypto_paillier/binary_search.py b/CTFs_and_WarGames/2014-ASIS-CTF/crypto_paillier/binary_search.py index 201c7c9..54f18be 100644 --- a/CTFs_and_WarGames/2014-ASIS-CTF/crypto_paillier/binary_search.py +++ b/CTFs_and_WarGames/2014-ASIS-CTF/crypto_paillier/binary_search.py @@ -24,10 +24,12 @@ def bs_paillier(lo, hi, s): if 'None' in ans: print "Found it!" return mid + 1 - elif 'Your secret' in ans: - return bs_paillier(lo, mid-1, s) + elif 'Your secret is' in ans: + print "too high" + return bs_paillier(mid, hi, s) else: - return bs_paillier(mid+1, hi, s) + print "too low" + return bs_paillier(lo, mid, s) @@ -42,8 +44,7 @@ def get_mod_paillier(): s.recv(4096) # start binary search - hi = pow(11,307) - lo = pow(10,307) + hi, lo = 11**307, 10**307 mod = bs_paillier(lo, hi, s) print mod diff --git a/README.md b/README.md index 59f41e8..945a628 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,7 @@ All in one big bag. -More [here]. - [here]: https://gist.github.com/bt3gl/8e3aa9538d6122f74274 -![](http://i.imgur.com/4WNqTJS.png) \ No newline at end of file +![](http://i.imgur.com/4WNqTJS.png)