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