
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
datadome-encryption
Advanced tools
A comprehensive reverse engineering analysis of DataDome's client-side encryption algorithm used in their anti-bot protection system alongside a npm module
This repository contains a complete analysis of DataDome's encryption system:
| Document | Description |
|---|---|
| README.md | Project overview and introduction |
| ENCRYPTION.md | Detailed analysis of the encryption algorithm |
| DECRYPTION.md | Implementation of the decryption process |
| technical_analysis.md | Technical deep-dive into cryptographic properties |
| LEARN.md | Educational guide on reverse engineering techniques |
Need DataDome Bypass Solutions?
If you need a reliable DataDome bypass solution for your project, turn to the experts who truly understand the technology. My company, TakionAPI, offers professional anti-bot bypass APIs with proven effectiveness against DataDome and other bot-defense systems.
No more worrying about understanding, reversing, and solving the challenge yourself, or about keeping it up to date every day. One simple API call does it all.
We provide free trials, example implementations, and setup assistance to make the entire process easy and smooth.
Visit TakionAPI.tech for real, high-quality anti-bot bypass solutions — we know what we're doing.
Install the module from npm:
npm install datadome-encryption
const { DataDomeEncryptor, DataDomeDecryptor } = require('datadome-encryption');
const cid = "YOUR_CLIENT_ID";
const hash = "YOUR_HASH_STRING";
const signals = [
["key1", "value1"],
["key2", 123],
// ... more key-value pairs
];
// Encryption
const encryptor = new DataDomeEncryptor(hash, cid);
signals.forEach(([key, value]) => encryptor.add(key, value));
const encrypted = encryptor.encrypt();
console.log('Encrypted:', encrypted);
// Decryption
const decryptor = new DataDomeDecryptor(hash, cid);
const decrypted = decryptor.decrypt(encrypted);
console.log('Decrypted:', decrypted);
Replace YOUR_CLIENT_ID and YOUR_HASH_STRING with your actual values. The signals array should contain your key-value pairs to encrypt.
check out tests/validity_check.js for a better understanding.

DataDome is a cybersecurity company valued at $33M specializing in bot detection and mitigation. This project decomposes their proprietary encryption mechanism, transforming the heavily obfuscated original code into a well-structured, documented implementation with a working decryption counterpart.
The project consists of:
encryption_original.js) - The obfuscated implementation extracted from DataDomeencryption_rewrite.js) - A structured, commented rewrite that maintains exact functionalitydecryption.js) - A complete implementation that can decrypt DataDome payloadstechnical_analysis.md) - Deep-dive into the algorithm's cryptographic propertiesThe reverse engineering process followed these steps (see ENCRYPTION.md for full details):
The first step involved isolating the encryption routine from DataDome's client-side JavaScript:
// Original obfuscated implementation (excerpt from encryption_original.js)
var Ea = function () {
if (Ta && s[150][460] != s[467][62]) return ya;
Math.ceil(4.1), Math.ceil(0.25), Ta = 1;
var e = 1789537805,
t = Math.floor(1.29),
a = parseInt(1567.97),
M = 9959949970,
g = !0;
// ... many more obfuscated lines
}
We identified three key functions in the encryption process:
d in the original) - A djb2 variant for input hashingD in the original) - A non-linear bit mixing algorithmI in the original) - Creates stateful pseudo-random generatorsThrough careful tracing and testing, we determined that the encryption process follows these steps:
The rewrite process involved:
DataDomeEncryptor)For a detailed walkthrough of the challenges encountered during this process, see Challenges and Methodologies in Reverse Engineering DataDome.
Implementing the decryption solution involved several unique challenges (see DECRYPTION.md for full details):
For a detailed explanation of the decryption implementation challenges, see Practical Decryption Challenges and Solutions.
const { DataDomeEncryptor } = require('./encryption_rewrite.js');
// Initialize with hash and client ID
const encryptor = new DataDomeEncryptor(
"14D062F60A4BDE8CE8647DFC720349",
"client_identifier_here"
);
// Add signals (key-value pairs)
encryptor.add("screenWidth", 1920);
encryptor.add("userAgent", "Mozilla/5.0...");
// Generate encrypted payload
const encrypted = encryptor.encrypt();
DataDome uses two primary challenge types with slightly different encryption parameters:
// CAPTCHA challenge (default)
const captchaEncryptor = new DataDomeEncryptor(
"14D062F60A4BDE8CE8647DFC720349",
"client_identifier_here",
null, // optional salt
"captcha" // challenge type
);
// Interstitial challenge
const interstitialEncryptor = new DataDomeEncryptor(
"14D062F60A4BDE8CE8647DFC720349", // can be the same hash
"client_identifier_here",
null, // optional salt
"interstitial" // challenge type
);
// You can also switch challenge types dynamically:
encryptor.setChallengeType("interstitial");
Interstitial challenges:
CAPTCHA challenges (default):
When decrypting data, make sure to specify the same challenge type that was used for encryption:
// Decrypting an interstitial challenge
const decryptor = new DataDomeDecryptor(
"14D062F60A4BDE8CE8647DFC720349",
"client_identifier_here",
null, // optional salt
"interstitial" // must match the challenge type used for encryption
);
The library automatically handles the differences in encryption/decryption algorithms between challenge types.
const { DataDomeDecryptor } = require('./decryption.js');
// Initialize with same parameters
const decryptor = new DataDomeDecryptor(
"14D062F60A4BDE8CE8647DFC720349",
"client_identifier_here",
null, // optional salt
"captcha" // challenge type - must match the encryption
);
// Decrypt payload
const decrypted = decryptor.decrypt(encryptedString);
console.log(decrypted);
// [["screenWidth", 1920], ["userAgent", "Mozilla/5.0..."]]
For a comprehensive analysis of the encryption algorithm, including:
See the Technical Analysis document.
encryption_original.js - The extracted, obfuscated original codeencryption_rewrite.js - Clean, commented implementationdecryption.js - Complete decryption implementationENCRYPTION.md - Detailed explanation of the encryption processDECRYPTION.md - Detailed explanation of the decryption implementationtechnical_analysis.md - In-depth cryptographic and security analysisLEARN.md - Educational guide on JavaScript reverse engineeringexample.js - Working example demonstrating encryption and decryptionIf you're interested in learning more about reverse engineering techniques used in this project, check out the LEARN.md guide. It provides:
This project demonstrates how even sophisticated obfuscation techniques can be methodically reversed through careful analysis. The clean implementation provides valuable insight into client-side security techniques and serves as an educational resource for understanding advanced JavaScript obfuscation patterns.
For legitimate security needs, standard cryptographic algorithms and WebCrypto APIs provide stronger protection than custom obfuscation techniques.
Despite DataDome being a $33M cybersecurity company specializing in bot protection, their encryption system reveals several concerning issues:
Unchanged Implementation: The encryption algorithm has remained virtually unchanged since the first release of their captcha challenge, making it a static target for reverse engineering efforts.
Security Through Obscurity: The system relies primarily on code obfuscation rather than cryptographically secure algorithms, creating a false sense of security.
Lack of Modern Cryptography: Instead of leveraging the Web Cryptography API or established encryption standards, DataDome uses a custom algorithm with questionable security properties.
Predictable Patterns: Once the algorithm is understood, the same techniques can be applied to decrypt all of DataDome's protected communications, as demonstrated by this project.
Insufficient Iteration: Serious security systems typically evolve over time to address vulnerabilities and strengthen protection. The static nature of this implementation suggests inadequate security review processes.
A more robust approach would involve:
This reverse engineering project serves as a case study in why organizations should avoid proprietary cryptographic implementations and instead rely on peer-reviewed, standardized algorithms when handling sensitive data or security-critical functions.
If you found this project helpful or interesting, consider starring the repo and following me for more security research and tools, or buy me a coffee to keep me up
Contributions are welcome! Please open issues or pull requests on GitHub. For guidelines, see CONTRIBUTING.md if present.
FAQs
DataDome encryption and decryption utilities for Node.js
We found that datadome-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
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.