Permalink
Browse files

changing hash algo from md5 to SHA256 in PubnubCrypto python-twisted …

…and python-tornado
  • Loading branch information...
1 parent 208910a commit fff74dfda535459178b511b8045cb05898ceca0c @devendram devendram committed Dec 4, 2012
Showing with 6 additions and 2 deletions.
  1. +3 −1 python-tornado/PubnubCrypto.py
  2. +3 −1 python-twisted/PubnubCrypto.py
@@ -60,7 +60,9 @@ def getSecret( self, key ):
#* @return key in MD5 format
#**
"""
- return MD5.new(key).digest()
+ m = hashlib.sha256()
+ m.update(key)
+ return m.hexdigest()[:32]
def encrypt( self, key, msg ):
"""
@@ -60,7 +60,9 @@ def getSecret( self, key ):
#* @return key in MD5 format
#**
"""
- return MD5.new(key).digest()
+ m = hashlib.sha256()
+ m.update(key)
+ return m.hexdigest()[:32]
def encrypt( self, key, msg ):
"""

0 comments on commit fff74df

Please sign in to comment.