Skip to main content

tgback — a program for backing and restoring Telegram accounts

Project description

TelegramBackup v5.1

Don't forget to look at changelog!

TelegramBackup — console application created to backup Telegram accounts. Due to the features of Telegram you will be not able to log into your account if you lose access to the phone number (SIM card). TGBACK provides the ability to create an alternative session (as if you were logging in from another device) and get login code or change the number on which the account is linked.

TelegramBackup produces a special .tgback file as well as a QR code - both are your backup. You can choose what is more convenient for you to store, as .tgback and a QR code represent the same session. For encryption of backups, AES-256-CBC is used with a scrypt key.

Download & Install

Windows

You can download builds from the Releases or from official TGBACK Channel.

Linux and making Windows executable

If you want to make a TelegramBackup app then you need to install all dependencies. For the program to work correctly, you need to have Python 3.7+, ZBar (for QR features, you may ignore it) and pip (it can be already installed with Python 3.7+, type pip or pip3 in your terminal/cmd). After that, run:

# You can install TGBACK from PIP
pip install tgback[QR] # Not a Pure-python, with QR
# pip install tgback # Pure-python, no QR support
# Or install from GitHub with GIT by cloning repository
git clone https://github.com/NotStatilko/tgback
pip install ./tgback[QR] # Not a Pure-python, with QR
# pip install ./tgback # Pure-python, no QR support
tgback # Run installed TGBACK app

If you want to make executable on Linux or Windows then install pyinstaller

pip install pyinstaller

Go to tgback/pyinstaller (you should clone repo from GitHub) folder and run

pyinstaller TelegramBackup.spec

After making TelegramBackup executable check it if it works and after that you can remove all tgback-related stuff (ZBar [if you not on linux], Python, etc).

Linux

If you want to use tgback on Linux with QR-features then you will need to have a libzbar0 (or analogue) onto your machine.

# Debian OS / Ubuntu OS
sudo apt install libzbar0

Backup creation

To create a backup you need to select first mode

main page

And choose the way you will create it.

backup

You can enter everything manually, or create a special tgback-config file. If the first method is inconvenient for you, create a text file and fill it out using this template:

phone_number; telegram_password; backup_password; backup_filename

Next, you will need to enter the code that Telegram will send you. If this doesn't happen, then you can request the code again. After three attempts, Telegram will call you and the robot will dictate it.

requestcode

After all operations, you will receive a QR code and .tgback file. Please check your backups for validity for first.

Backup refresh and number replacement

Due to discovered problem backups need to be updated periodically, so that the session doesn't turn off automatically due to inactivity. At the moment once every three months. We can probably increase it to five, but testing is needed.

TelegramBackup automatically creates a reminder message, so you will be notified a week before the deadline. You can refresh the backup and change the number in the mode under number 2. After refreshing the backup, you will receive a new updated QR code and .tgback file. Old backups will remain working, but they will be show the wrong amount of time before the expiration.

A bit about security

The backups you created shouldn't be active since the last update. If you notice something suspicious – immediately disconnect (via Destroy option or Telegram) your backup session. After disconnecting a session, ALL backups that are attached to it will be inacessible.

TelegramBackup backups store session, upon receipt of which the attacker will receive FULL control over your account. Use complex passwords.

Also, no security audits have been conducted by competent people, so I do not guarantee complete cryptographic strength. If you have any suggestions, open issue. I am attaching a QR-backup of my account here, try to hack it if you want!

Involved libraries

  1. Telethon (MIT License)
  2. Pillow (PIL Software License)
  3. PyAES (MIT License)
  4. PyZBar (MIT License)
  5. python-qrcode (LICENSE)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tgback-5.2.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

tgback-5.2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file tgback-5.2.tar.gz.

File metadata

  • Download URL: tgback-5.2.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for tgback-5.2.tar.gz
Algorithm Hash digest
SHA256 0c58e66de00f7db4bd01dc9772f0dbb3570beb6840562a65350eb730ffa3e999
MD5 5c832c7e11b44e421e77ad451775fa60
BLAKE2b-256 8548e8501b84cade7d19ebadbf8ccedcae0aa3caa85d71b120e6e6f308938119

See more details on using hashes here.

File details

Details for the file tgback-5.2-py3-none-any.whl.

File metadata

  • Download URL: tgback-5.2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for tgback-5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5709963846695e2a4fa4db6a561d90deaccd1f7fcb5d9fe4a0365998733085e4
MD5 41429fe55e69c58b2db47831aa3631d2
BLAKE2b-256 1af09f4ab83b0f1cea276f38920f95cae400d66010cd5ce729bef4ca02734322

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page