🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-native-rsa-native

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-rsa-native - npm Package Compare versions

Comparing version

to
1.0.4

android/src/main/java/com/RNRSA/RNRSAKeychainModule.java

2

index.js

@@ -7,4 +7,4 @@

export { RNRSAKeychain };
export { RNRSAKeychain, RNRSAKeychain as RSAKeychain, RNRSA, RNRSA as RSA };
export default RNRSA;
{
"name": "react-native-rsa-native",
"version": "1.0.3",
"version": "1.0.4",
"description": "A native implementation of RSA key generation and encryption/decryption.",

@@ -5,0 +5,0 @@ "main": "index.js",

# react-native-rsa-native
A native implementation of RSA key generation and encryption/decryption.
A native implementation of RSA key generation and encryption/decryption, sign/verify.
Keychain implementation
Implementation is in PKCS1

@@ -8,4 +9,4 @@

Android: Generation, Encryption, Decryption
iOS: Generation, Encryption, Decryption
Android: Generation, Encryption, Decryption, Sign, Verify, keychain support
iOS: Generation, Encryption, Decryption, Sign, Verify, keychain support

@@ -34,3 +35,3 @@ *Need to check cross platform encrypt/decrypt

import RSA, {RNRSAKeychain} from 'react-native-rsa-native';
import {RSA, RSAKeychain} from 'react-native-rsa-native';

@@ -41,11 +42,21 @@ RSA.generate()

console.log(keys.public) // the public key
RNRSA.encrypt('1234', keys.public)
RSA.encrypt('1234', keys.public)
.then(encodedMessage => {
RNRSA.decrypt(encodedMessage, keys.private)
RSA.decrypt(encodedMessage, keys.private)
.then(message => {
console.log(message)
console.log(message);
})
})
})
RSA.sign(secret, keys.private)
.then(signature => {
console.log(signature);
RSA.verify(signature, secret, keys.public)
.then(valid => {
console.log(valid);
})
})
})
// Example utilizing the keychain for private key secure storage

@@ -56,13 +67,12 @@

RNRSAKeychain.generate(keyTag)
RSAKeychain.generate(keyTag)
.then(keys => {
console.log(keys.public);
console.log(secret);
RSA.encrypt(secret, keyTag)
RSAKeychain.encrypt(secret, keyTag)
.then(encodedMessage => {
console.log(encodedMessage);
RSA.decrypt(encodedMessage, keyTag)
RSAKeychain.decrypt(encodedMessage, keyTag)
.then(message => {

@@ -72,3 +82,13 @@ console.log(message);

})
});
RSAKeychain.sign(secret, keyTag)
.then(signature => {
console.log(signature);
RSAKeychain.verify(signature, secret, keyTag)
.then(valid => {
console.log(valid);
})
})
});
```

@@ -75,0 +95,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet