DataDome Encryption System: Python Implementation
A clean Python implementation of DataDome's client-side encryption and decryption, with a simple classes and practical usage examples.
Table of Contents
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.
- 📄 Check our straightforward documentation
- 🚀 Start your trial
- 💬 Contact us on Discord for custom development and support.
Visit TakionAPI.tech for real, high-quality anti-bot bypass solutions — we know what we're doing.
Installation & Quick Start
Install the module from PyPI:
pip install datadome-encryption
Basic Usage Example
import json
from datadome_encryption import DataDomeDecryptor, DataDomeEncryptor
cid = "YOUR_CLIENT_ID"
hash_str = "YOUR_HASH_STRING"
signals = [
["key1", "value1"],
["key2", 123],
# ... more key-value pairs
]
# Encryption
encryptor = DataDomeEncryptor(hash_str, cid, ctype="captcha")
for key, value in signals:
encryptor.add(key, value)
encrypted = encryptor.encrypt()
print('Encrypted:', encrypted)
# Decryption
decryptor = DataDomeDecryptor(hash_str, cid, ctype="captcha")
decrypted = decryptor.decrypt(encrypted)
print('Decrypted:', decrypted)
Replace YOUR_CLIENT_ID and YOUR_HASH_STRING with your actual values. The signals list should contain your key-value pairs to encrypt.
Full Example: Encryption/Decryption Validity Check
import json
from datadome_encryption import DataDomeDecryptor, DataDomeEncryptor
if __name__ == "__main__":
cid = "k6~sz7a9PBeHLjcxOOWjR162xQq2Uxsx6wLzxeGlO7~6k3JVwDkwAaQ04wdFEMm2Jt2s0y61mLfJdhWuqtqeJzFMuo7Lf8P5btYX0K4EeoLRcNAtNW04rGhTE3nKpMxi"
hash_str = "14D062F60A4BDE8CE8647DFC720349"
excepted_encrypted = open("excepted.txt", "r", encoding="utf-8").read()
original_signals = json.loads(open("original.json", "r", encoding="utf-8").read())
decryptor = DataDomeEncryptor(hash_str, cid, ctype="captcha")
for key, value in original_signals:
decryptor.add(key, value)
encrypted = decryptor.encrypt()
# We ignore the last char on compilation due to the
# fact that is salt based, so unless you pass
# the same salt it will be a different char based
# on the timestamp
print(f"Encryption matches expected? {encrypted[:-1] == excepted_encrypted[:-1]}")
decryptor = DataDomeDecryptor(hash_str, cid, ctype="captcha")
rebuild_decrypted = decryptor.decrypt(encrypted)
original_decrypted = decryptor.decrypt(excepted_encrypted)
mismatch = False
for rebuild, original in zip(rebuild_decrypted, original_decrypted):
rebuild_key, rebuil_value = rebuild[0], rebuild[1]
original_key, original_value = original[0], original[1]
if rebuild_key != original_key or \
rebuil_value != original_value:
mismatch = True
print(f"(ORIGINAL) Mismatch {original_key} {original_value=}")
print(f"(REBUILD ) Mismatch {rebuild_key} {rebuil_value=}")
print("*"*20)
print(f"Got any mismatch on decryption? {mismatch}")
About This Project
This repository provides a clean, well-documented Python implementation of DataDome's client-side encryption and decryption logic. It is designed for:
- Security researchers
- Developers integrating with DataDome-protected endpoints
- Anyone interested in reverse engineering or cryptography
For a full technical analysis, reverse engineering details, and a Node.js implementation, see the Node.js version and the Medium article.
Converting from NodeJS
The hardest part of converting the module from NodeJS to Python was ensuring that all calculations were correctly translated and still executed as 32-bit operations, just as NodeJS/JavaScript does—whereas Python uses 64-bit integers by default.
Author
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
Development
Running Tests
Install development dependencies:
pip install -r requirements-dev.txt
Run tests with:
pytest
Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Metadata
Release files for datadome-encryption 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datadome_encryption-1.1.1.tar.gz | 12.9 kB | Without provenance | Details for datadome_encryption-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datadome_encryption-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for datadome_encryption-1.1.1-py3-none-any.whl |
Total release size: 23.6 kB
Release files / datadome_encryption-1.1.1.tar.gz
| Download URL | datadome_encryption-1.1.1.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80daf0a7e04a35cd133e6d61879ade67cd13994177678f82ad43e8c4fb7520ca
|
|
BLAKE2b-256 checksum How to use checksums |
e6a0483a8eb03336678e30f118d939f2ed81666a611b6d8c8ebb9aa0ed412ec8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / datadome_encryption-1.1.1-py3-none-any.whl
| Download URL | datadome_encryption-1.1.1-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3beeb2cf21e35ce6f50c7c9a1656c8c68d4b385ee037d935d00e91d5942d8bbb
|
|
BLAKE2b-256 checksum How to use checksums |
d4419a252536752d053a80487549ee6b382cbdf21b9261d5941b982e540077d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for datadome-encryption 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.