zerobias / telegram-mtproto

Telegram client api (MTProto) library
MIT License
617 stars 136 forks source link

How to save api_id and api_hash on client securely? #190

Closed Mondei1 closed 5 years ago

Mondei1 commented 6 years ago

I'm currently working on a electron application and I don't know how to save my key that nobody can access it. Maybe I have to write a backend that's run on my server and handle all requests there.

But is there any way to do it directly from the client?

VladimirEfstafiev commented 6 years ago

Unfortunately (as far as I know) electron doesn't have source code protection. Have you heard about NW.js? If you want to secure your sources it will definitely help. NW.js code protection mechanism.

Mondei1 commented 6 years ago

Oh thanks, I will take a look at this. I think that will solve my problem.

Mondei1 commented 6 years ago

@VladimirEfstafiev NW.js will not work. Because I'm currently developing a widget for something. So I think I have to develop a own backend for that.

davydof commented 6 years ago

@Mondei1 Hello, did you logged in to telegram API? Could you please help me with it?

Mondei1 commented 6 years ago

@adavidof Yeah, I was logged in. It's not that hard. Sorry for this late response, forget this here a little bit.

davydof commented 6 years ago

@Mondei1, @zerobias

I use these versions:

"mtproto-storage-fs": "^0.3.1",
"telegram-mtproto": "2.2.2"

on local machine it works properly but on the node server(heroku) I got this error:

Error 401 AUTH_KEY_UNREGISTERED 2 1

with the same auth keys and node modules and code base.

what I missed?

Mondei1 commented 6 years ago

@adavidof That's weird... I recommend to open a separate issue for that, because this does not fit into this topic here.