Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-native-aes-256
Advanced tools
This React Native library provides a secure and convenient way to encrypt and decrypt data using the industry-standard AES-256 algorithm. It seamlessly integrates with your React Native application, allowing you to protect sensitive information on both An
This React Native library provides a secure and convenient way to encrypt and decrypt data using the industry-standard AES-256 algorithm. It seamlessly integrates with your React Native application, allowing you to protect sensitive information on both Android and iOS platforms.
Key Features:
Installation
Dependency Installation: Install the library using npm or Yarn:
npm install react-native-aes-256
yarn add react-native-aes-256
Platform-Specific Linking:
pod install
in your iOS project directory.Usage
Import the functions:
import { encrypt, decrypt, generateSecureKey, generateSecureIV } from 'react-native-aes-256';
Encryption:
// Optional you can use any 32 character string
const secureKey = await generateSecureKey('your_password');
// Optional you can use any 16 character string
const iv = await generateSecureIV('another_password');
const encryptedData = await encrypt(secureKey, iv, 'your_data_to_encrypt');
Decryption:
const decryptedData = await decrypt(secureKey, iv, encryptedData);
API Reference
encrypt(secureKey: string, iv: string, toBeEncrypted: string): Promise<string>
: Encrypts a string using the provided key and IV.decrypt(secureKey: string, iv: string, toBeDecrypted: string): Promise<string>
: Decrypts a string using the provided key and IV.generateSecureKey(password: string): Promise<string>
: Generates a secure key from a password.generateSecureIV(password: string): Promise<string>
: Generates a secure initialization vector (IV) from a password.Error Handling
encrypt
and decrypt
functions reject promises with informative error messages if the key or IV lengths are invalid.IV
length should be 16SecrueKey
length should be 32Security Considerations
Example
A basic example of encrypting and decrypting data can be found in the example folder.
License
This library is licensed under the (MIT License).
FAQs
This React Native library provides a secure and convenient way to encrypt and decrypt data using the industry-standard AES-256 algorithm. It seamlessly integrates with your React Native application, allowing you to protect sensitive information on both An
We found that react-native-aes-256 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.