Skip to content

Commit

Permalink
tweaks to encap_bchk
Browse files Browse the repository at this point in the history
  • Loading branch information
jakinyele committed Jul 15, 2013
1 parent 25abdea commit 2fb9bfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions charm/schemes/encap_bchk05.py
Expand Up @@ -16,14 +16,14 @@ def __init__(self):
H = hashlib.sha1()

def setup(self):
pub = hashlib.md5()
pub = hashlib.sha256()
return pub

def S(self, pub):
x = randomBits(448)
x = str(x).zfill(135)

r = hashlib.md5(x.encode('utf-8')).digest()
r = hashlib.sha256(x.encode('utf-8')).digest()

com = hashlib.sha1(x.encode('utf-8')).digest()[:128]

Expand All @@ -35,7 +35,7 @@ def R(self, pub, com, dec):
x = hashlib.sha1(str(dec).encode('utf-8')).digest()[:128]

if(x == com):
m = hashlib.md5(str(dec).encode('utf-8')).digest()
m = hashlib.sha256(str(dec).encode('utf-8')).digest()
return m
else:
return b'FALSE'
Expand Down

0 comments on commit 2fb9bfd

Please sign in to comment.