🔐 How to Make a Hash Generator Telegram Bot Using Termux [2025 Guide]

Want to build your own Telegram bot that generates cryptographic hashes (MD5, SHA1, SHA256, SHA512) on-the-fly? This hands-on tutorial will show you how to create a fully functional hash generator bot using just Termux and Python—no rooting or advanced setup needed. Perfect for beginners in ethical hacking, cybersecurity, or automation using Telegram bots. 👨💻
Learn how to build a Telegram Hash Generator bot using Termux & Python. Follow this step-by-step guide to generate MD5, SHA1, SHA256, and SHA512 hashes instantly with your bot.
📘 What is a Hash Generator Telegram Bot?
A Hash Generator bot is a Telegram bot that converts input text into cryptographic hash values using various algorithms like MD5, SHA1, SHA256, and SHA512. These hashes are widely used in password storage, data verification, and cybersecurity practices.
📱 Requirements to Get Started
- ✅ Android phone with Termux installed
- ✅ Working internet connection
- ✅ Python installed in Termux
- ✅ A Telegram account
- ✅ Telegram Bot Token from @BotFather
🛠️ Step 1: Set Up Python and Required Modules
Update your Termux and install Python:
pkg update && pkg upgrade
pkg install python
pip install pyTelegramBotAPI
🤖 Step 2: Create a New Telegram Bot
- Open Telegram and search @BotFather
- Type
/newbot
and follow the instructions - Set a name and a username (e.g., HashMasterBot)
- Copy the token it gives you—we'll need it for the script
💻 Step 3: Create the Hash Generator Script in Termux
In your Termux terminal, run:
nano hash_bot.py
Paste the following code (replace 'YOUR_BOT_TOKEN_HERE'
with your actual token):
import telebot
import hashlib
TOKEN = 'YOUR_BOT_TOKEN_HERE'
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start'])
def welcome(message):
bot.reply_to(message, "🔐 Send any text and I'll generate MD5, SHA1, SHA256 & SHA512 hashes.")
@bot.message_handler(func=lambda message: True)
def generate_hashes(message):
text = message.text.encode()
reply = f"🧾 Input: {message.text}\n\n"
reply += f"🔐 MD5: {hashlib.md5(text).hexdigest()}\n"
reply += f"🔐 SHA1: {hashlib.sha1(text).hexdigest()}\n"
reply += f"🔐 SHA256: {hashlib.sha256(text).hexdigest()}\n"
reply += f"🔐 SHA512: {hashlib.sha512(text).hexdigest()}"
bot.send_message(message.chat.id, reply, parse_mode='HTML')
bot.polling()
Save the file by pressing CTRL + X
→ Y
→ Enter
.
🚀 Step 4: Run the Bot
Execute the script by typing:
python hash_bot.py
Now open Telegram, find your bot, and send any message. Your bot will instantly reply with four different types of secure hashes. 🔐
🔁 Bonus Tip: Prevent Termux From Sleeping
Use this command to keep your session active:
termux-wake-lock
Or use tmux
/ nohup
to run in the background.
🔎 Why Build a Hash Generator Bot?
- ✔️ Verify file or message integrity
- ✔️ Teach cryptography basics in ethical hacking sessions
- ✔️ Quickly hash sensitive data without online tools
📚 Related Articles
- 🛠️ Top 45 Ethical Hacking Tools for Linux (2025)
- 🌐 Find Private IP of Wi-Fi Users Using Termux & Nmap
💬 Final Thoughts by Kumar’s Magic
That’s it! In just a few steps, you've created a useful Telegram bot that demonstrates the power of hashing in cybersecurity. This is more than just a tool—it’s a learning project to spark your Python + Termux automation journey. Feel free to expand this bot with features like file hashing, command menus, or inline support.
👉 Follow Kumar's Magic for more Termux tricks, Telegram bot ideas, and real-world hacking utilities.
Made with ❤️ by kumarsmagic.com