Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/AginSquash/2FA-Telegram

This telegram bot written in Python will help you access the 2FA codes. All your keys for generating 2FA are stored in an encrypted file. Used Fernet symmetric encryption.
https://github.com/AginSquash/2FA-Telegram

2fa 2fa-codes 2fa-keys fernet pyotp python telegram-bot twofactorauth

Last synced: 3 months ago
JSON representation

This telegram bot written in Python will help you access the 2FA codes. All your keys for generating 2FA are stored in an encrypted file. Used Fernet symmetric encryption.

Lists

README

        

# 2FA-Telegram
## What is it?
This simple telegram bot written in Python will help you access the 2FA codes.
All your keys for generating 2FA are stored in an encrypted file (used Fernet symmetric encryption.
## Setup
#### 1. Dependencies
Firstly you need to install dependencies ([telepot](https://github.com/nickoala/telepot), [pyotp](https://github.com/pyauth/pyotp), [cryptography](https://github.com/pyca/cryptography)) using:

pip3 install -r requirements.txt

#### 2. Registration
Send a message [BotFather](https://telegram.me/botfather) and register a bot. I recommend using the bot's name as random as possible
>for example: mhdpjuh7wgdhumy9z2_bot

#### 3. Config file
Now you need to create a file **`config.py`** like this:

token = "1234567:XXXXXXXXXXXXX"

Run the bot and write him any message. A message will appear in the console like this: `"Chat id: 98765432"`.
Now place this id to the config file. As a result, the file should look like this:

token = "1234567:XXXXXXXXXXXXX"
admin_id = 98765432

## Usage
#### 1. Setting 2FA key-store password
**/pass** - This command sets a password to the repository.

Using like
> /pass 1a2b3c4d5e6

I recommend resetting the password variable after using the bot:
> /pass null

You need to re-enter the password for the next use after this command.
It's help you to secure store your 2FA-keys.

**Attention! Before use `/add` and `/get` you need set password for key-store**

#### 2. Adding service
**/add** - This command add service to the repository.
> /add [service_name] [key]

For example:
> /add PyOTP_Test JBSWY3DPEHPK3PXP

#### 3. Get 2FA codes
**/get** - This command return 2FA-code to the repository.
> /get [service_name]

`/get` without args return full list of service_name + 2FA-code

Example:
> /get PyOTP_Test

#### 4. Delete or change password
For security reasons, you can not remove the service through the bot (this is a feature). To delete (or receive data without telegram bot, or change local key-store password) use `CodesEditor.py` local.

>python3 `CodesEditor.py`

## Thanks
I want to thank the developers of these beautiful libraries:
[telepot](https://github.com/nickoala/telepot), [pyotp](https://github.com/pyauth/pyotp), [cryptography](https://github.com/pyca/cryptography).