{"id":23914479,"url":"https://github.com/ra101/masquerbot","last_synced_at":"2025-04-11T15:50:35.576Z","repository":{"id":43268041,"uuid":"278855368","full_name":"ra101/MasquerBot","owner":"ra101","description":"A TelegramBot for true paranoids.","archived":false,"fork":false,"pushed_at":"2025-02-26T05:30:41.000Z","size":594,"stargazers_count":9,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"core","last_synced_at":"2025-03-25T11:52:26.084Z","etag":null,"topics":["apscheduler","cryptography","ecdsa","flask","flask-restful","flask-sqlalchemy","gunicorn","hashing","heroku","pixel-manupulation","postgres","postgresql","pytelegrambotapi","python","sqlalchemy","stegano","steganography","telegram","telegram-bot","webhook"],"latest_commit_sha":null,"homepage":"https://t.me/MasquerBot","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ra101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://www.buymeacoffee.com/ra101"]}},"created_at":"2020-07-11T12:16:25.000Z","updated_at":"2025-02-26T05:21:36.000Z","dependencies_parsed_at":"2022-08-22T16:00:32.064Z","dependency_job_id":null,"html_url":"https://github.com/ra101/MasquerBot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ra101%2FMasquerBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ra101%2FMasquerBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ra101%2FMasquerBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ra101%2FMasquerBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ra101","download_url":"https://codeload.github.com/ra101/MasquerBot/tar.gz/refs/heads/core","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248434480,"owners_count":21102845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apscheduler","cryptography","ecdsa","flask","flask-restful","flask-sqlalchemy","gunicorn","hashing","heroku","pixel-manupulation","postgres","postgresql","pytelegrambotapi","python","sqlalchemy","stegano","steganography","telegram","telegram-bot","webhook"],"created_at":"2025-01-05T10:14:04.311Z","updated_at":"2025-04-11T15:50:35.568Z","avatar_url":"https://github.com/ra101.png","language":"Python","readme":"\r\n\u003cdiv align=\"center\"\u003e\r\n\u003ch1\u003e MasquerBot \u003c/h1\u003e\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"./assets/logo_circle.png\" width=\"250px\" height=\"250px\"\u003e\r\n\u003c/p\u003e\r\n\r\n \u003ca href=\"https://t.me/MasquerBot\" alt=\"https://t.me/MasquerBot\" \u003e\u003ch2\u003e https://t.me/MasquerBot \u003c/h2\u003e \u003c/a\u003e \r\n\r\n\u003cimg src=\"https://img.shields.io/badge/Made%20with-Python-feab00?style=for-the-badge\u0026amp;logo=python\" alt=\"Made with Python\"\u003e \u003ca href=\"https://github.com/ra101/MasquerBot/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/ra101/MasquerBot?style=for-the-badge\" alt=\"Stars\"\u003e\u003c/a\u003e \u003ca href=\"https://github.com/ra101/MasquerBot/network/members\"\u003e\u003cimg src=\"https://img.shields.io/github/forks/ra101/MasquerBot?style=for-the-badge\" alt=\"Forks\"\u003e\u003c/a\u003e \u003ca href=\"https://github.com/ra101/MasquerBot/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/ra101/MasquerBot?style=for-the-badge\" alt=\"Open Issues\"\u003e \u003c/a\u003e\u003cimg src=\"https://img.shields.io/badge/Open%20Source-%E2%98%95-red?style=for-the-badge\u0026amp;logo=open-source-initiative\" alt=\"Open Source Love\"\u003e  \u003cimg src=\"https://img.shields.io/badge/Built%20With-%E2%99%A1-critical?style=for-the-badge\u0026amp;logo=github\" alt=\"Built with Love\"\u003e\r\n\r\n\u003c/div\u003e\r\n\r\nThis `TelegramBot` uses state-of-the-art encryption algorithm *(ECDSA)* and pixel manipulation *(steganography)* to masque any given `\u003ctext\u003e` within any given `\u003cimage\u003e`.\r\n\r\n- _If you truly have a paranoia about security. A VPN is recommended during [/encrypt](#desktop_computer-available-commands) and [/decrypt](#desktop_computer-available-commands)._\r\n\r\n- _PNGs are recommended better performance._\r\n\r\n\r\n\u003cbr\u003e\r\n\r\n### ⚡Features:\r\n\r\n- Saves `Hashes` instead of username.\r\n- `unique constraint` prevents duplicacy. \r\n- Message is first `encrypted` then `steganography` is performed.\r\n- `ECDSA` is used, which means less time on computation and powerful encryption.\r\n- `Dynamic URL`: URL changes every `6 hours and 5 minutes`, with `130 char long`, making it impossible to send through any means other than telegram since URL remains unknown to everyone except telegram.\r\n- `Gunicorn` creates multiple workers hence supporting parallel processing.\r\n- Process Management: All processes are cancelled before starting a new one. `Triggers` are added to delete any process with a timestamp older than 10 minutes.\r\nA few cool `Easter Eggs` are there as well.\r\n\r\n\r\n\u003cbr\u003e\r\n\r\n**Video Tutorial:** [LRBY](https://lbry.tv/@ra101/MasquerBot)  |  [YouTube](https://www.youtube.com/watch?v=yH3SVmCZD7Q)\r\n\r\n\u003cp align=\"center\"\u003e\r\n \u003ciframe id=\"odysee-iframe\" style=\"width:74vw;height:42vw;\" src=\"https://odysee.com/$/embed/MasquerBot/11376992c29c54efde884284b298a1290ae8d7f8?r=45vpskZGbEGUURSfgbmqd6b53WGvvGuh\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen\u003e\u003c/iframe\u003e\r\n\u003c/p\u003e\r\n\r\n\r\n\u003cbr\u003e\u003cbr\u003e\r\n\r\n## 💼About\r\n\r\n### 📈Workflow\r\n\r\nHow this works is, that everyone is given a public key, which is used to lock information, we call it \"public key\" as it can be publicly distributed. \r\n\r\nSo to masque a message both sender and receiver must initiate MasquerBot's Service. Each message is masqued only for the receiver, if the receiver changes their key then decryption would be impossible.\r\n\r\n\u003cbr\u003e\r\n\r\n### 🖥Available Commands:\r\n\r\n- [**/start**](#desktop_computer-available-commands):  It starts and calls **/help** and **/get_key**\r\n- [**/lbry**](#desktop_computer-available-commands) or [**/youtube**](#desktop_computer-available-commands): Return a link of video tutorial. \r\n- [**/help**](#desktop_computer-available-commands):  Returns the `Workflow` and `Available Commands` .\r\n- [**/get_key**](#desktop_computer-available-commands):  Returns your `public key`.\r\n- [**/encrypt**](#desktop_computer-available-commands):  Returns the `encoded image`.\r\n  - Step 1: Send the `message` to encrypt.\r\n  - Step 2: Send the recipient's `public key` **(not yours)**.\r\n  - Step 3: Send the `image` **(as a document)**.\r\n- [**/decrypt**](#desktop_computer-available-commands):  Returns the `hidden text`.\r\n  - Step 1: Send the `encoded image` **(as a document)**.\r\n- [**/cancel**](#desktop_computer-available-commands):  Cancels any ongoing events.\r\n- [**/request_new_key**](#desktop_computer-available-commands):  Deletes your account and creates another one. **Beware! Once deleted you cant retrieve any text masqued using the previous key.** \r\n\r\n\r\n\u003cbr\u003e\r\n\r\n## ⚙Development\r\n\r\n### 💾Setup\r\n\r\nThe following are the bare necessities for this project.\r\n\r\n- [Python3](https://www.python.org/downloads/)\r\n- [TelegramBot with its API key](https://core.telegram.org/bots#3-how-do-i-create-a-bot)\r\n\r\n\r\n\r\nLets start the standard procedure for python project setup.\r\n\r\n- Clone the repository\r\n\r\n```bash\r\n$ git clone https://github.com/ra101/MasqureBot.git\r\n```\r\n\r\n- Create the virtualenv and activate it\r\n\r\n```bash\r\n$ cd MasqureBot\r\n$ virtualenv .\r\n$ source ./bin/activate # unix\r\n$ .\\Scripts\\activate.bat  # windows\r\n```\r\n\r\n- Install requirements\r\n```bash\r\n$ pip install -r requirements.txt\r\n```\r\n\r\n\u003cbr\u003e\r\n\r\n### 💻Run on localhost\r\n\r\nTo run the project locally download and install\r\n\r\n- [ngrok](https://ngrok.com/download)\r\n\r\n\r\n\r\nFollowing are the steps to run locally\r\n\r\n- copy content of .env.template into .env *(one can use [dump-env](https://github.com/sobolevn/dump-env) as well)*\r\n\r\n```bash\r\n$ cat .env.template \u003e .env\r\n```\r\n\r\n- Fillup the basic info.\r\n\r\n```bash\r\nDOMAIN_NAME=\r\n\r\n\r\n# Flask Variables\r\n# ------------\r\nFLASK_DEBUG=True\r\nFLASK_ENV=development\r\nFLASK_SECRET_KEY=my_precious\r\n\r\n\r\n# SQLAlchemy Variables\r\n# ------------\r\nDATABASE_URL=\r\nSQLALCHEMY_TRACK_MODIFICATIONS=True\r\n\r\n\r\n# Telegram Credentials\r\n# ------------\r\nTELEGRAM_BOT_TOKKEN=\u003cyour_bot_token\u003e\r\n```\r\n\r\n\r\n\r\n- For `DOMAIN_NAME`\r\n\r\n  - run the following command\r\n\r\n    ```bash\r\n    $ ngrok http 8000\r\n    ```\r\n\r\n  - This will create a local tunnel with address like `https://\u003cnonce\u003e.ngrok.io` that is your value for domain.\r\n\r\n- For `DATABASE_URL` \r\n\r\n  - If you use SQLite, that create a file and it does not need any other software. `sqlite:///foo.db`\r\n\r\n    is the value for `DATABASE_URL` is that case.\r\n\r\n  - For any other SQL the syntax is `dialect+driver://username:password@host:port/database` , here `dialect` refers to SQL. We have used postgreSQL which uses `psycopg2` as default driver which is installed from `requirements.txt`\r\n\r\n\r\n\r\n- Run the application!\r\n\r\n```bash\r\n$ make\r\n```\r\n\r\nor \r\n\r\n```bash\r\n$ gunicorn wsgi:application -c scheduler.py\r\n```\r\n\r\n\u003cbr\u003e\r\n\r\n###  ☁Run on Server\r\n\r\nFollowing are the steps to run on server.\r\n\r\n- If you can host .env, then the steps are pretty much same as running locally, except for `DOMAIN_NAME` , it will be provided by hosting provider.\r\n\r\n- If you can't host .env like in case of `heroku`, then you need to export each variable into hosting providers environment.\r\n\r\n\r\n\u003cbr\u003e\u003cbr\u003e\r\n\r\n\r\n## 📃Breakdown of `requirements.txt`\r\n\r\n| Dependency       | Usage                                                        |\r\n| ---------------- | ------------------------------------------------------------ |\r\n| APScheduler      | Creates a background scheduler in `scheduler.py` which changes webhook URL in every 6 hours and 5 minutes |\r\n| eciespy          | Generates ECDSA key pair and also provides encryption and decryption functionality |\r\n| Flask            | Flask is a lightweight [WSGI](https://wsgi.readthedocs.io/) web application framework. |\r\n| Flask-RESTful    | Adds support for quickly building REST APIs.                 |\r\n| Flask-SQLAlchemy | Provides a Object Relation Mapper which is meant to integrate with |\r\n| gunicorn         | It is a Python WSGI HTTP server. It is a pre-fork worker model, used to create concurrency for resources. |\r\n| psycopg2-binary  | Driver for postgreSQL used by Flask-SQLAlchemy               |\r\n| pyTelegramBotAPI | A simple, but extensible Python implementation for the Telegram Bot API. |\r\n| python-dotenv    | Reads the key-value pair from `.env` file and adds them to environment variable. |\r\n| stegano          | A pure Python Steganography module.                          |\r\n\r\n\u003cbr\u003e\u003cbr\u003e\r\n\r\n\r\n## 🎁Donations\r\n\r\n\u003ca href=\"https://www.buymeacoffee.com/ra101\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/black_img.png\" title=\"If this project is helpful to you and love my work and feel like showing love/appreciation, would you like to buy me a coffee?\" \u003e\u003c/a\u003e\r\n\r\n\u003cbr\u003e\r\n\r\n## 🌟Credit/Acknowledgment\r\n\r\n[![Contributors](https://img.shields.io/github/contributors/ra101/MasquerBot?style=for-the-badge)](https://github.com/ra101/MasquerBot/graphs/contributors)\r\n\r\n\u003cbr\u003e\r\n\r\n## 📜License\r\n\r\n[![License](https://img.shields.io/github/license/ra101/MasquerBot?style=for-the-badge)](https://github.com/ra101/MasquerBot/blob/core/LICENSE)\r\n\r\n\u003cbr\u003e\r\n\r\n## 🤙Contact Me\r\n\r\n[![Protonmail](https://img.shields.io/badge/Protonmail-Email-ab44fe?style=for-the-badge\u0026logo=protonmail)](mailto://agarwal.parth.101@protonmail.com) [![Telegram](https://img.shields.io/badge/Telegram-Chat-informational?style=for-the-badge\u0026logo=telegram)](https://telegram.me/ra_101)\r\n","funding_links":["https://www.buymeacoffee.com/ra101"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fra101%2Fmasquerbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fra101%2Fmasquerbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fra101%2Fmasquerbot/lists"}