Subversion Repositories SmartDukaan

Rev

Rev 18097 | Rev 18099 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18097 Rev 18098
Line 29... Line 29...
29
import urllib2
29
import urllib2
30
import uuid
30
import uuid
31
import gdshortener
31
import gdshortener
32
from dtr.dao import AppOfferObj, UserAppBatchDrillDown, UserAppBatchDateDrillDown
32
from dtr.dao import AppOfferObj, UserAppBatchDrillDown, UserAppBatchDateDrillDown
33
import base64
33
import base64
34
from falcon.util.uri import decode
-
 
35
 
34
 
36
alphalist = list(string.uppercase)
35
alphalist = list(string.uppercase)
37
alphalist.remove('O')
36
alphalist.remove('O')
38
numList = ['1','2','3','4','5','6','7','8','9']
37
numList = ['1','2','3','4','5','6','7','8','9']
39
codesys = [alphalist, alphalist, numList, numList, numList]
38
codesys = [alphalist, alphalist, numList, numList, numList]
Line 1607... Line 1606...
1607
    def on_get(self,req,resp):
1606
    def on_get(self,req,resp):
1608
        message_type = req.get_param("type")
1607
        message_type = req.get_param("type")
1609
        print 'type', message_type
1608
        print 'type', message_type
1610
        if message_type == 'encrypt':
1609
        if message_type == 'encrypt':
1611
            encryption_data = req.get_param("data")
1610
            encryption_data = req.get_param("data")
1612
            print 'encryption data ',decode(encryption_data)
1611
            print 'encryption data ', base64.decodestring(encryption_data)
1613
            encrypted_data = encryptMessage(decode(encryption_data))
1612
            encrypted_data = encryptMessage(base64.decodestring(encryption_data))
1614
            print 'encrypted data ', encrypted_data
1613
            print 'encrypted data ', encrypted_data
1615
            resp.body =  json.dumps({"result":{"value":encrypted_data}}, encoding='utf-8')
1614
            resp.body =  json.dumps({"result":{"value":encrypted_data}}, encoding='utf-8')
1616
            
1615
            
1617
        elif message_type == 'decrypt':
1616
        elif message_type == 'decrypt':
1618
            decryption_data = req.get_param("data")
1617
            decryption_data = req.get_param("data")