Skip to content

Can you help me understand this part "new RSA(buff.slice(22"? #37

@hugomosh

Description

@hugomosh

I am writing the library to work on React Native, I have come to the part to encrypt the WiFi password. Can you explain me why it takes the 21 first bits? of the public Key?
First time using encryption.

SoftAP.prototype.publicKey = function publicKey(cb) {
	is(cb);
	this.__sendCommand({ name: 'public-key' }, function response(err, dat) {
		checkResponse(err, dat, cb);
		var buff = new Buffer(dat.b, 'hex');
		this.__publicKey = new RSA(buff.slice(22), 'pkcs1-public-der', {
			encryptionScheme: 'pkcs1'
		});
		cb(null, this.__publicKey.exportKey('pkcs8-public'));
	}.bind(this));
};

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions