
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-fast-rsa
Advanced tools
$ npm install react-native-fast-rsa --save
If you want to use with NativeModules instead of JSI you need to set
import RSA from "react-native-fast-rsa";
RSA.useJSI = false;
if you need to use generate methods it is a good idea to disable it, because for now JSI will block your UI but it is faster compared to NativeModules
export interface PCKS12KeyPair {
publicKey: string;
privateKey: string;
certificate: string;
}
export interface KeyPair {
publicKey: string;
privateKey: string;
}
export enum Hash {
MD5 = 0,
SHA1 = 1,
SHA224 = 2,
SHA256 = 3,
SHA384 = 4,
SHA512 = 5,
}
export enum PEMCipher {
DES = 0,
D3DES = 1,
AES128 = 2,
AES192 = 3,
AES256 = 4,
}
export enum SaltLength {
AUTO = 0,
EQUALS_HASH = 1,
}
class RSA {
static convertJWKToPrivateKey(data: any, keyId: string): Promise<string>
static convertJWKToPublicKey(data: any, keyId: string): Promise<string>
static convertKeyPairToPKCS12(privateKey: string, certificate: string, password: string): Promise<string>
static convertPKCS12ToKeyPair(pkcs12: string, password: string,): Promise<PCKS12KeyPair>
static convertPrivateKeyToPKCS8(privateKey: string,): Promise<string>
static convertPrivateKeyToPKCS1(privateKey: string): Promise<string>
static convertPrivateKeyToJWK(privateKey: string): Promise<any>
static convertPrivateKeyToPublicKey(privateKey: string): Promise<string>
static convertPublicKeyToPKIX(publicKey: string): Promise<string>
static convertPublicKeyToPKCS1(publicKey: string): Promise<string>
static convertPublicKeyToJWK(publicKey: string): Promise<any>
static decryptPrivateKey(privateKeyEncrypted: string, password: string,): Promise<string>
static encryptPrivateKey(privateKey: string, password: string, cipherName: Cipher): Promise<string>
static decryptOAEP(message: string, label: string, hashName: Hash, privateKey: string): Promise<string>
static decryptPKCS1v15(message: string, privateKey: string,): Promise<string>
static decryptOAEPBytes(message: Uint8Array, label: string, hashName: Hash, privateKey: string): Promise<Uint8Array>
static decryptPKCS1v15Bytes(message: Uint8Array, privateKey: string,): Promise<Uint8Array>
static encryptOAEP(message: string,label: string, hashName: Hash, publicKey: string): Promise<string>
static encryptPKCS1v15(message: string, publicKey: string): Promise<string>
static encryptOAEPBytes(message: Uint8Array,label: string, hashName: Hash, publicKey: string): Promise<Uint8Array>
static encryptPKCS1v15Bytes(message: Uint8Array, publicKey: string): Promise<Uint8Array>
static signPSS(message: string, hashName: Hash, saltLengthName: SaltLength, privateKey: string): Promise<string>
static signPKCS1v15(message: string, hashName: Hash, privateKey: string): Promise<string>
static signPSSBytes(message: Uint8Array, hashName: Hash, saltLengthName: SaltLength, privateKey: string): Promise<Uint8Array>
static signPKCS1v15Bytes(message: Uint8Array, hashName: Hash, privateKey: string): Promise<Uint8Array>
static verifyPSS(signature: string, message: string, hashName: Hash, saltLengthName: SaltLength, publicKey: string): Promise<boolean>
static verifyPKCS1v15(signature: string, message: string, hashName: Hash, publicKey: string): Promise<boolean>
static verifyPSSBytes(signature: Uint8Array, message: Uint8Array, hashName: Hash, saltLengthName: SaltLength, publicKey: string): Promise<boolean>
static verifyPKCS1v15Bytes(signature: Uint8Array, message: Uint8Array, hashName: Hash, publicKey: string): Promise<boolean>
static hash(message: string, name: Hash): Promise<string>
static base64(message: string): Promise<string>
static generate(bits: number): Promise<KeyPair>
}
the native library is made in Golang for faster performance
https://github.com/jerson/rsa-mobile
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
library for use RSA
The npm package react-native-fast-rsa receives a total of 2,835 weekly downloads. As such, react-native-fast-rsa popularity was classified as popular.
We found that react-native-fast-rsa demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.