I am trying to log in to the Steam website. How the authorization takes place can be found here (CLoginPromptManager.prototype.OnRSAKeyResponse)
To encrypt the key using the library phplibsec. I encrypt the password as follows:
public function encryptPassword($password, $publickey_exp, $publickey_mod) { $RSA = new RSA(); $RSA->setEncryptionMode(RSA::ENCRYPTION_PKCS1); $key = [ 'modulus' => new BigInteger($publickey_mod, 16), 'publicExponent' => new BigInteger($publickey_exp, 16) ]; $RSA->loadKey($key, RSA::PUBLIC_FORMAT_RAW); return urlencode(base64_encode($RSA->encrypt($password))); } Everything worked until a certain point, then started issuing errors:
Notice (1024): Message representative out of range [ROOT/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php, line 2225] Fatal error: Call to a member function toBytes() on boolean in /var/www/cakephp/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php on line 2062 or
Notice (1024): Integer too large [ROOT/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php, line 2064] var_dump:
public_exp: 010001 public_mod: BBF843183FFAB35A7AB5DF426389B553372A7DEB10031A219C80EDC165BD5C3EFC4AAAA69CFBF9E20D829B62937A1E24AF0F190B72435E47C93934D0E566F6EBFB481CF17E726792D016F3D8227061B5D5A452DAC2EA5475051EFC511B0C64F1EE8D2E3D975E4838774232185312D7F9795F6679845500B46BA148173A11DC8CC5F1D2EEAC1AEE820FC4FA86AC562666E30E6D38FF867AB5988B44FC51BC08664BD3B7432570217157240972D732FC0931CD91785193D59FAC783B45F554364E307693E313B3FBD1828FC67CEED3BC33380D3FDB4463B971EE2BCB798253C5377BCBF1A258055192E2D6A27CC3BA70E8E3C4AF7D5049ED55D96C212D34B63AE3 Help fix the problem.
update:
Project repository: github.com/SpekToR-ru/Awesomenauts-Match-Players
I tried to do password encryption via js (like on the site of the incentive), but it hasn’t taken off yet - the answer of the incentive: Incorrect login.
Ps. Join who is interested in this topic)