https://github.com/inoribea/sdns-calculator
DNS Stamp calculator component for Python
https://github.com/inoribea/sdns-calculator
dns dnscrypt dnscrypt-proxy doh python
Last synced: about 2 months ago
JSON representation
DNS Stamp calculator component for Python
- Host: GitHub
- URL: https://github.com/inoribea/sdns-calculator
- Owner: inoribea
- License: mit
- Created: 2025-03-14T10:15:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-14T10:37:12.000Z (about 1 year ago)
- Last Synced: 2025-03-14T11:28:49.041Z (about 1 year ago)
- Topics: dns, dnscrypt, dnscrypt-proxy, doh, python
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sdns-calculator
DNS Stamp calculator component for Python. This tool generates DNS Stamps (for DoH/DoT/DoQ) by retrieving server certificates and computing necessary hashes locally.
**Note:** This tool requires an active internet connection to retrieve the server's SSL/TLS certificate, which is essential for generating the DNS Stamp. The calculation of the DNS Stamp itself is performed locally after the certificate is obtained.
- Thanks to jedisct1.
- Code implementations sourced from [stamps-specifications](https://dnscrypt.info/stamps-specifications/)
## Why
This project was created to provide a local solution for generating DNS Stamps, particularly when direct certificate and hash computation through tools like dnscrypt-proxy is challenging. It aims to fill the gap for users seeking a straightforward, script-based approach.
## Use
1. Install Python (3.7+)
2. Install the `cryptography` Python module: `pip install cryptography`
3. Download the script for your language (e.g., `sdns-calculator.py`)
4. Run it from your terminal: `python sdns-calculator.py`
Additionally, you can now select "Certificate Info" (option 5) to retrieve detailed server certificate information (Subject, Issuer, Serial Number, Validity, SHA256 Fingerprint, and TBS SHA256 Hash) for DoH/DoT protocols.
**Important Note for Windows Users:**
If you encounter an `ImportError: DLL load failed while importing _rust: The specified procedure could not be found.` error when running the script, it is highly likely that your system is missing or has an outdated **Microsoft Visual C++ Redistributable** package. The `cryptography` library, which `sdns-calculator` depends on for secure operations, relies on these runtime components.
To resolve this issue:
1. **Download and install the latest Microsoft Visual C++ Redistributable**
* You can find the official download here: [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/cpp/windows/latest-supported-vc-redist)
* It's generally recommended to download and install both the `x86` and `x64` versions, even if your Python installation is 64-bit, to ensure full compatibility.
2. **Restart your computer** after installation to ensure the changes take effect system-wide.
3. (Optional but recommended) If you've already tried to run the script and encountered the error *before* installing the redistributable, it's a good idea to reinstall `cryptography` after installing the redistributable: `pip install --force-reinstall cryptography`
If you encounter any problems during use, please submit your issues.