aboutsummaryrefslogtreecommitdiffstats
path: root/Pubnub.py
diff options
context:
space:
mode:
Diffstat (limited to 'Pubnub.py')
-rw-r--r--Pubnub.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Pubnub.py b/Pubnub.py
index 4a53eb1..83d243e 100644
--- a/Pubnub.py
+++ b/Pubnub.py
@@ -215,10 +215,13 @@ class PubnubCrypto2():
def decrypt(self, key, msg):
- secret = self.getSecret(key)
- Initial16bytes = '0123456789012345'
- cipher = AES.new(secret[0:32], AES.MODE_CBC, Initial16bytes)
- plain = self.depad(cipher.decrypt(decodestring(msg)))
+ try:
+ secret = self.getSecret(key)
+ Initial16bytes = '0123456789012345'
+ cipher = AES.new(secret[0:32], AES.MODE_CBC, Initial16bytes)
+ plain = self.depad(cipher.decrypt(decodestring(msg)))
+ except:
+ return msg
try:
return eval(plain)
except SyntaxError: