#
import crypt
-import sha
+import hashlib
import hmac
import time
# We encode in UTF-8 before calculating the HMAC, which is
# an 8-bit algorithm.
# python 2.6 insists on receiving a 'str' as opposed to a 'unicode'
- digest = hmac.new(str(key), msg.encode('utf-8'), sha).hexdigest()
+ digest = hmac.new(str(key), msg.encode('utf-8'), hashlib.sha1).hexdigest()
if digest != auth['value']:
raise PLCAuthenticationFailure, "Call could not be authenticated"
from types import StringTypes
from datetime import datetime
-import md5
+import hashlib
import time
from random import Random
import re
else:
# Generate a somewhat unique 8 character salt string
salt = str(time.time()) + str(Random().random())
- salt = md5.md5(salt).hexdigest()[:8]
+ salt = hashlib.md5(salt).hexdigest()[:8]
return crypt.crypt(password.encode(self.api.encoding), magic + salt + "$")
validate_date_created = Row.validate_timestamp