Skip to content

Commit

Permalink
IV mandatory on CFB
Browse files Browse the repository at this point in the history
  • Loading branch information
rep committed Sep 21, 2012
1 parent 95620c2 commit 12cc211
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py/pwrcall/util.py
Expand Up @@ -57,12 +57,12 @@ def rand32():
return struct.unpack('I', os.urandom(4))[0]

def gen_forwarder(secret, obj, nonce, options={}):
a = AES.new(secret, AES.MODE_CFB)
a = AES.new(secret, AES.MODE_CFB, IV=secret)
return a.encrypt( msgpack.packb((nonce, id(obj), options)) )

# returns (fp, obj, nonce)
def cap_from_forwarder(secret, fwd):
a = AES.new(secret, AES.MODE_CFB)
a = AES.new(secret, AES.MODE_CFB, IV=secret)
return msgpack.unpackb( a.decrypt(fwd) )

def parse_url(url):
Expand Down

0 comments on commit 12cc211

Please sign in to comment.