Skip to content

Commit

Permalink
Change blocksize to 16
Browse files Browse the repository at this point in the history
  • Loading branch information
dlbroadfoot authored Apr 15, 2018
1 parent 5ec1fbd commit eec63c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygogogate2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def open_device(self, device_id):
return self.activate(device_id)


BS = 8
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s: s[0:-s[-1]]

Expand All @@ -149,4 +149,4 @@ def decrypt(self, enc):
iv = enc[:16]
enc = base64.b64decode(enc[16:])
cipher = AES.new(self.key, AES.MODE_CBC, iv)
return unpad(cipher.decrypt(enc))
return unpad(cipher.decrypt(enc))

0 comments on commit eec63c9

Please sign in to comment.