Go Telegram Bot: Password Manager

Fuchsoria
2 min readApr 16, 2022

Last week I thought that sometimes Telegram messenger is very useful for quick-send of passwords or any text information across your devices. But it’s not every time secure when you save raw passwords/text somewhere in messengers. And I decided to develop a password manager into a telegram bot, first what I thought that it should be safe and encrypted and so I decided on such a technical stack:

A bit about UI:

View for non-registered user
View for registered & locked user
View for unlocked user
Passwords view

A bit about technical realization:

Register key:

  1. User registers key by command
  2. Key hashed and saved
  3. Created user with user_id from telegram and key hash

Unlock manager:

  1. Send key by unlocking command /unlock
  2. Hash key and check it in DB
  3. Save the key in memory by user_id
  4. Return unlocked UI

Add password:

  1. Send password
  2. Use the stored key from the memory
  3. Encrypt password
  4. Save encrypted password in DB

Show passwords:

  1. Render UI with passwords by name
  2. After clicking on the password find the encrypted password in DB
  3. Use the stored key from the memory
  4. Decrypt password and return password for 10 seconds

You can find a demo preview here: https://t.me/EncryptedWalletBot

And all sources are in GitHub repository: https://github.com/Fuchsoria/Encrypted-Password-Manager

--

--