fix: default OAEP hash to sha1 for Node.js compatibility#951
Merged
Conversation
publicEncrypt and privateDecrypt defaulted the OAEP hash to SHA-256 when no oaepHash option was specified. Node.js defaults to SHA-1, causing data encrypted by Node.js (or any standard implementation) to fail decryption.
Contributor
🤖 End-to-End Test Results - AndroidStatus: ✅ Passed 📸 Final Test ScreenshotScreenshot automatically captured from End-to-End tests and will expire in 30 days This comment is automatically updated on each test run. |
Contributor
🤖 End-to-End Test Results - iOSStatus: ✅ Passed 📸 Final Test ScreenshotScreenshot automatically captured from End-to-End tests and will expire in 30 days This comment is automatically updated on each test run. |
boorad
added a commit
that referenced
this pull request
Feb 24, 2026
New pages: PQC (ML-DSA/ML-KEM), Argon2, KMAC, Certificate (SPKAC), and Utilities (one-shot hash, timingSafeEqual, primes, introspection). Updated 8 existing pages with missing API sections: SubtleCrypto (deriveBits, deriveKey, wrapKey/unwrapKey, encapsulation), Keys (KeyObject.from, equals, toCryptoKey), Signing (standalone sign/verify), DiffieHellman (diffieHellman function), Ed25519 (Ed448/X448), Hash (crypto.hash one-shot, SHA3), ECDH (convertKey), and reorganized the API index into Core/Key Exchange/Key Derivation/Advanced sections. Annotated 7 pages with behavioral notes from recent fix PRs (#929, #930, #932, #933, #939, #948, #949, #951, #954, #955): cipher single-use warning, generateKeys preservation, PBKDF2 validation, OAEP hash default, randomFill view correctness, RSA-* aliases, and flexible curve names. Added llms.txt index route and fixed llms-full.txt JSX stripping in source.ts to produce clean LLM-friendly output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
publicEncryptandprivateDecryptdefaulted the OAEP hash to SHA-256 when nooaepHashoption was specified. Node.js (and the PKCS#1 v2.2 / RFC 8017 spec) defaults to SHA-1, causing data encrypted by Node.js or any standard-compliant implementation to fail decryption in RNQC.Changes
oaepHashfrom'SHA-256'to'sha1'in bothpublicEncryptandprivateDecryptcrypto.publicEncryptwith default OAEP settingsTesting
oaepHashspecified)Fixes #950