hermes-tdata 🚀
Pure Rust parser for Telegram Desktop's tdata storage.
Extract sessions and authentication keys from Telegram Desktop's local storage (tdata) without launching the official client, using Qt, or relying on Python.
⚡️ Features
- Pure Rust: No dependencies on Qt, C++, or Python. Statically linked and blazing fast.
- Cross-Platform: Works on Linux, Windows, and macOS tdata folders.
- Cryptography: Full implementation of TDesktop's custom encryption scheme:
- PBKDF2-SHA512 key derivation with custom parameters.
- AES-256-IGE encryption implementation.
- Custom MD5/SHA1 file integrity verification.
- MTP Parsing:
- Parses
key_data(local keys). - Parses
mapfiles (account data). - Extracts
AuthKey,UserId, andDcId. - Supports new (64-bit ID) and legacy tdata formats.
- Parses
- Interoperability:
- Generates session strings compatible with
grammers(Rust). - Easily adaptable for
telethonorpyrogram.
- Generates session strings compatible with
- Multi-Account: Automatically detects and extracts all active accounts.
📦 Installation
Add this to your Cargo.toml:
[]
= "0.1"
🚀 Quick Start
Convert tdata to Session String
use TDesktop;
use PathBuf;
🛠 CLI Utility
This crate includes a ready-to-use CLI tool to inspect tdata and extract sessions.
# Run directly from source
# Or specify a custom path
# With passcode
Output example:
📂 Reading tdata from: "/home/user/.local/share/TelegramDesktop/tdata"
✅ Successfully loaded TDesktop storage!
App Version: 6004001
Passcode: NO
Accounts: 2
👤 Account #1 (Index 0)
User ID: 123456789
DC ID: 2
Session: 1/33p1... (ready for grammers)
👤 Account #2 (Index 1)
User ID: 987654321
DC ID: 2
Session: 1/5a2b...
🔒 Security Note
This library deals with sensitive authentication keys.
- Never share your
tdatafolder or the output of this tool. - Anyone with the
AuthKeycan access your Telegram account without 2FA. - This tool runs locally on your machine and does not transmit keys anywhere.
🤝 Acknowledgements
📜 License
MIT or Apache-2.0