Skip to content

Commit

Permalink
fix: previous commit also applies for Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
knipknap committed Nov 28, 2017
1 parent bac2765 commit 04d9571
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Exscript/util/crypt.py
Expand Up @@ -369,9 +369,10 @@ def otp(password, seed, sequence):
raise ValueError('seed composition')
if sequence < 0:
raise ValueError('sequence')
if sys.version_info[0] >= 3:
seed = seed.encode('utf-8')
password = password.encode('utf-8')

# Pycryptodome only supports byte strings.
seed = seed.encode('utf-8')
password = password.encode('utf-8')

# Discard the first <sequence> keys
thehash = MD4.new(seed + password).digest()
Expand Down

0 comments on commit 04d9571

Please sign in to comment.