How to use node-bignumber - 5 common examples

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
var json;
		try {
			json = JSON.parse(body);
		} catch(e) {
			deleteMobileCookies();
			callback(e);
			return;
		}

		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"
		};
github node-pinus / pinus / packages / pinus / lib / components / connector.ts View on Github external
setPubKey(id: number, key: { rsa_n: string, rsa_e: string }) {
        let pubKey = new rsa.Key();
        pubKey.n = new rsa.BigInteger(key.rsa_n, 16);
        pubKey.e = key.rsa_e;
        this.keys[id] = pubKey;
    }
github alfathdirk / LineAlphatJS / src / pinVerifier.js View on Github external
getRSACrypto(json) {
    const rsa = new RSA.Key();
    const chr = String.fromCharCode;
    const sessionKey = json.sessionKey;
    const message =
      utf8.encode(chr(sessionKey.length) +
      sessionKey + chr(this.id.length) +
      this.id + chr(this.password.length) + this.password);
    rsa.setPublic(json.nvalue, json.evalue);
    const credentials = rsa.encrypt(message).toString('hex');
    const keyname = json.keynm;
    return { keyname, credentials, message };
  }
}
github node-pinus / pinus / packages / pinus / lib / components / connector.ts View on Github external
setPubKey(id: number, key: { rsa_n: string, rsa_e: string }) {
        let pubKey = new rsa.Key();
        pubKey.n = new rsa.BigInteger(key.rsa_n, 16);
        pubKey.e = key.rsa_e;
        this.keys[id] = pubKey;
    }
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