C# Encrypt Text Output

前端 未结 9 1303
没有蜡笔的小新
没有蜡笔的小新 2020-12-14 13:37

I have created a few little programs that export data to a text file using StreamWriter and then I read them back in using StreamReader. This works great and does what I nee

9条回答
  •  臣服心动
    2020-12-14 14:23

    You can add a checksum or hash to the file - if the file contents doesn't agree with the checksum, you know it was tampered with.

    If it is important that users can't read the contents of the file, you can encrypt it.

    I don't believe you can make a file that can't be tampered with (a savvy user could use a hex editor and change it, for example) - the best you can do is detect such tampering.

提交回复
热议问题