react-native-rsa-native
react-native-rsa-native copied to clipboard
[question] What encryption type is used?
What encryption type is used by this library? I would like to use RSA-PSS to match my webcrypto code:
await crypto.subtle.generateKey(
{
name: "RSA-PSS",
hash: "SHA-256",
modulusLength: 4096,
publicExponent: new Uint8Array([1, 0, 1]),
},
true,
["sign", "verify"],
);
After digging in the Android and IOS code, it uses the RSA_PKCS1 according to RFC 3447 - section 7.2.
To change them, you must go into RSA.java and update the Algorithm in lines 132 and 154.
final Cipher cipher = Cipher.getInstance("RSA/NONE/PKCS1Padding");
A similar analysis can be done for IOS.