
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
deadmanswitch-encryption
Advanced tools
Cross-platform encryption library for React Native and React web applications with password-based encryption
Cross-Platform Encryption Library
A lightweight, cross-platform encryption library that works seamlessly with both React Native and React web applications. Uses password-based encryption with PBKDF2 key derivation and AES-GCM encryption.
npm install @deadmanswitch/encryption
For React Native, you'll also need to install the crypto dependency:
npm install react-native-quick-crypto
After installation, you'll need to complete the platform setup. For React Native 0.60+, run:
cd ios && pod install
import { encrypt, decrypt } from '@deadmanswitch/encryption';
// Encrypt data
const encryptData = async () => {
const result = await encrypt('Hello, World!', {
password: 'your-secure-password'
});
console.log('Encrypted:', result.encryptedData);
console.log('Salt:', result.salt);
console.log('IV:', result.iv);
return result;
};
// Decrypt data
const decryptData = async (encryptionResult) => {
const decrypted = await decrypt({
password: 'your-secure-password',
encryptedData: encryptionResult.encryptedData,
salt: encryptionResult.salt,
iv: encryptionResult.iv
});
console.log('Decrypted:', decrypted); // "Hello, World!"
return decrypted;
};
import { decrypt } from '@deadmanswitch/encryption';
// Decrypt data received from React Native
const decryptData = async () => {
const decrypted = await decrypt({
password: 'your-secure-password',
encryptedData: 'encrypted-data-from-rn',
salt: 'salt-from-rn',
iv: 'iv-from-rn'
});
console.log('Decrypted:', decrypted);
return decrypted;
};
encrypt(data: string, options: EncryptionOptions): Promise<EncryptionResult>Encrypts a string using password-based encryption.
Parameters:
data - The string to encryptoptions - Encryption options
password - The password to use for encryptioniterations? - Number of PBKDF2 iterations (default: 100000)keyLength? - Key length in bits (default: 256)Returns: Promise resolving to an EncryptionResult containing:
encryptedData - Base64 encoded encrypted datasalt - Base64 encoded saltiv - Base64 encoded initialization vectordecrypt(options: DecryptionOptions): Promise<string>Decrypts data using password-based decryption.
Parameters:
options - Decryption options
password - The password used for encryptionencryptedData - Base64 encoded encrypted datasalt - Base64 encoded saltiv - Base64 encoded initialization vectoriterations? - Number of PBKDF2 iterations (default: 100000)keyLength? - Key length in bits (default: 256)Returns: Promise resolving to the decrypted string
The library automatically detects the platform and uses the appropriate implementation:
react-native-quick-crypto for native performanceFull TypeScript support is included with exported interfaces:
import type {
EncryptionOptions,
EncryptionResult,
DecryptionOptions
} from '@deadmanswitch/encryption';
MIT
FAQs
Cross-platform encryption library for React Native and React web applications with password-based encryption
We found that deadmanswitch-encryption 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.