예제 #1
0
def time_simple(messages, nbits):
    times = []
    for m in messages:
        start_time = datetime.now()
        public, private = mmm.gen_keys(nbits)
        crypto = mmm.encrypt(m, public)
        enc_message = mmm.decrypt(crypto, private)
        times.append((datetime.now() - start_time).total_seconds())
    return times
예제 #2
0
파일: trade.py 프로젝트: mistake1989/demo
 def findPwd(self):
     self.sendcode()
     password = '******'
     l = self.getPublicKey()
     print(l[1])
     word = encrypt(l[1], password)
     url = 'http://192xxxxxxxxxxx/user/user/findPwd'
     headers = {'Content-Type': 'application/json'}
     data ={'findType':1,'mobile':'13719657675','mobileCode':'666666','password':word,'publicCode':l[1],'shortCode':'+86','username':'******'}
     response = requests.post(url, headers=headers, data=json.dumps(data))
     print(response.json())
예제 #3
0
파일: trade.py 프로젝트: mistake1989/demo
 def register(self):
     self.sendcode()
     url = 'http://192xxxxxxxxxxx/user/user/register'
     headers = {'Device-Type':'app','Content-Type':'application/json'}
     password = '******'
     l = self.getPublicKey()
     print(l[1])
     word = encrypt(l[1],password)
     print(word)
     data = {'mobile':'13719657675','msgCode':'666666','password':word,'publicCode':l[0],'registerType':1,'shortCode':'+86','username':'******'}
     response = requests.post(url,proxies=proxies,headers=headers,data=json.dumps(data))
     print(response.json())
예제 #4
0
파일: trade.py 프로젝트: mistake1989/demo
 def login(self):
     self.sendcode()
     url = 'http://192xxxxxxxxxxx/user/user/login'
     headers = {'Device-Type':'web','Content-Type':'application/json'}
     password = '******'
     l = self.getPublicKey()
     print(l[1])
     word = encrypt(l[1],password)
     print(word)
     data = {'loginType':1,'mobile':'13719657675','mobileCode':'666666','password':word,'publicCode':l[1],'shortCode':'+86','username':'******'}
     response = requests.post(url,headers=headers,data=json.dumps(data))
     print(response.json())
     return response.json()['data']['token']
예제 #5
0
def login(username):
    content = 'ab123456'
    headers = {
        'User-Agent':
        'Exx_pro/4.3.6 (com.exx.pro; build:4.3.61; iOS 12.4.0) Alamofire/4.7.3',
        'Content-Type': 'application/x-www-form-urlencoded'
    }
    uri = 'http://tmaxxxxx/api/m/V2_0/login'
    password = encrypt(key, content)
    data1 = {
        'appKey':
        'sDbDoEiBVCfjL1OTL7enygUJCVu3W4I2qyXPkSN13DY0PFDjyWStxIKvl3oVnAkZVUNKO4uO0tP4GHrZ85E8rBxT',
        'countryCode': '+86',
        'dynamicCode': '',
        'googleCode': '',
        'lang': 1,
        'osType': 1,
        'password': password,
        'token': '',
        'userId': '',
        'userName': username
    }
    # print(plus(**data1))
    # print(appSecret+plus(**data1)+appKey)
    # print(password)
    sig = md5(appSecret + md5(plus(**data1)) + appKey).lower()
    # print(sig)
    data = {
        'appKey':
        'sDbDoEiBVCfjL1OTL7enygUJCVu3W4I2qyXPkSN13DY0PFDjyWStxIKvl3oVnAkZVUNKO4uO0tP4GHrZ85E8rBxT',
        'countryCode': '+86',
        'dynamicCode': '',
        'googleCode': '',
        'lang': 1,
        'osType': 1,
        'password': password,
        'sign': sig,
        'token': '',
        'userId': '',
        'userName': username
    }
    response = requests.post(uri, data=data)
    print(response.json())
    print(response.json()['datas']['token'])
    return response.json()['datas']['token']