Answer the question
In order to leave comments, you need to log in
Error with RSA steam?
import sys
from Crypto.Util.number import long2str
sys.path.append(r'E:\anaconda\Lib\site-packages')
import requests
import time
import base64
from Crypto.Cipher import PKCS1_v1_5
import time
from Crypto.PublicKey import RSA
get_rsakey_url = 'https://store.steampowered.com/login/getrsakey/'
login_url = 'https://store.steampowered.com/login/dologin/'
login_headers = {
'Referer':'https://store.steampowered.com/login/',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36',
}
req = requests.session()
sign_dict = {'account_incorrect_sign':1,'guard_fail_sign':1}
def get_login_rsakey():
# После ввода неправильного пароля учетной записи в первый раз он будет установлен на 0, и он должен быть установлен на 1 в начале
sign_dict['guard_fail_sign'] = 1
username = "username"
password = "pass"
data = {
'donotcache':str(int(time.time()*1000)),
'username':username
}
getkey_html = req.post(get_rsakey_url,data=data,headers=login_headers).json()
mod = getkey_html.get('publickey_mod')
exp = getkey_html.get('publickey_exp')
timestamp = getkey_html.get('timestamp')
rsa_key = RSA.construct((mod,exp))
print(rsa_key)
rsa = PKCS1_v1_5.PKCS115_Cipher(rsa_key)
encrypted_password = base64.b64encode(rsa.encrypt(password))
return username,encrypted_password,timestamp
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question