How to safely store encryption key in a .NET assembly

前端 未结 3 823
耶瑟儿~
耶瑟儿~ 2020-12-19 02:37

In order to prevent somebody from grabbing my data easily, I cache data from my service as encrypted files (copy protection, basically).

However, in order to do thi

3条回答
  •  無奈伤痛
    2020-12-19 03:07

    You cannot prevent decription, but you can prevent re-encryption of falsified data:

    As long as your code runs on a computer accessible by others, there is no way you can prevent them from examining the program. Decompiling and Analysis does cost time however. As MaxGuernseyIII points out, it is all about acceptable threat levels.

    In your case the problem is not so much that that a hacker can decompile your code, but much more that they can change the data you want to protect (who owns the license).

    So you can use a public key cryptography method to encrypt the data. That way the hacker can read, but he cannot re-encrypt.

提交回复
热议问题