Store client secret securely

后端 未结 5 550
说谎
说谎 2020-12-16 05:43

I know that a public client shouldn\'t use a client secret because, no matter how much you obfuscate it, it won\'t be protected from reverse engineering.

But, the

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-16 05:50

    As you said, whatever you do, how much you try to hide your key, you can not hide it 100%. But, if you want to make reverse engineer's work harder;

    Firstly obfuscate your client (I guess you already do).

    Secondly, do not put your key into the client hard-coded. Receive the key after login or user opened the application. And deliver secret key to the client over SSL. Store the secret as byte array and do not save it into the client. Just store in the memory.

    These steps do not guarantee the safety of the secret key, but makes reverse engineer's job really hard.

提交回复
热议问题