How to use the node-bignumber.hex2b64 function in node-bignumber

To help you get started, we’ve selected a few node-bignumber examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DoctorMcKay / node-steamcommunity / index.js View on Github external
if(!json.publickey_mod || !json.publickey_exp) {
			deleteMobileCookies();
			callback(new Error("Invalid RSA key received"));
			return;
		}
		
		var key = new RSA();
		key.setPublic(json.publickey_mod, json.publickey_exp);
		
		var form = {
			"captcha_text": details.captcha || "",
			"captchagid": self._captchaGid,
			"emailauth": details.authCode || "",
			"emailsteamid": "",
			"password": hex2b64(key.encrypt(details.password)),
			"remember_login": "true",
			"rsatimestamp": json.timestamp,
			"twofactorcode": details.twoFactorCode || "",
			"username": details.accountName,
			"oauth_client_id": "DE45CD61",
			"oauth_scope": "read_profile write_profile read_client write_client",
			"loginfriendlyname": "#login_emailauth_friendlyname_mobile"
		};
		
		self.request.post({
			"uri": "https://steamcommunity.com/login/dologin/",
			"json": true,
			"form": form,
			"headers": mobileHeaders
		}, function(err, response, body) {
			deleteMobileCookies();

node-bignumber

A pure javascript implementation of BigIntegers and RSA crypto.

Unrecognized
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis