F
F
finkvi2017-05-08 19:47:32
Messengers
finkvi, 2017-05-08 19:47:32

How private is chatid on Telegram?

Dear, tell me, how correct is it to use the chatid of a private chat, as the user's confidential information, when writing a bot?
We have a regular private chat, in which the bot and the user. Let's say I want to generate some kind of private key for a user and do sha256(chatid). Now everyone who knows the chatid of the user's chat and the bot also knows the user's private key. The question is, who knows the chatid (except for the user and the bot)? Who theoretically can recognize it? believing that Telegram is reliable)
PS: The idea to generate a private key arises from the reluctance to store confidential user data anywhere in the bot application. Yes, you can request a password or passphrase from the user himself, but then you will have to request it every time you need it. Or randomly generate the key yourself, but then you have to store
it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Trakhimenok, 2017-05-08
@astec

As far as I understand chatid is known only to the bot. Not the fact that the same id is used on the client, although who knows.
If the chatid on the client is the same as that of the bot, then man in the middle can find out because the chat with the bot is not secret with end-to-end encryption.
If you are going to store encrypted user data with a chatid key in the bot database, it is not clear how this will help, because the data in the database will most likely be associated with this chat is and, accordingly, the key can be calculated if the sources are available. If the data is downloaded and uploaded by the user as a file, then it's probably not a bad scheme.
Maybe I'll make a backup for my bot

A
Andrey Shatokhin, 2017-05-09
@Sovigod

As far as I remember - chatid of a private conversation with a bot, for a bot it is equal to the user id. Digital id of course. And it is available for all other bots and some clients. That is, this is very public information, and it is not difficult to find out.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question