Skip to content

Commit

Permalink
DES operations have to be brought back to a signed value
Browse files Browse the repository at this point in the history
  • Loading branch information
benallard committed Jan 23, 2013
1 parent 2580f07 commit a465988
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pythoncard/security/key.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from pythoncard.utils import s1

def _longToArray(long):
"""
Used to transform long to Array
Expand Down Expand Up @@ -29,7 +31,7 @@ def _arrayTolong(bytes):
return l

def _binaryToarray(bytes):
return [ord(c) for c in bytes]
return [s1(ord(c)) for c in bytes]

def _arrayTobinary(array):
return ''.join([chr(i & 0xff) for i in array])
Expand Down

0 comments on commit a465988

Please sign in to comment.