-3

I want to know if there's a way to create a file that only my application can read but other programs (eg: notepad) can't

For example: i create a config file from my application, and if i open it with notepad it will be garbled nonsense, like:

½ÁoLG0%­Ö9)9Ìm•~0ý<öKfƒ”ü9´~<ƒ\,Aëxzºv‡@u}ž¹ñ7µK³¨]fÛn {盞Ժî*Ò\úǃ«E%ñ x@Â˼†ZÜŸ¹>Çðϕޢdóü0¹ñS`|ÛV‰‡Fëm¬2°,üdVNÆ$å^Rf­¾!v¼ñ ¡ýù´ÿËjC&¤œšÍÉ]ËÈFæTñq%#++ÜÝ[êq"@hbÍj‰Œ‚äd¡†¸<×sæå‘óùOë\2rxy

Zachary Craig
  • 2,192
  • 4
  • 23
  • 34
  • 2
    Please read [Ask] and take the [Tour] – Ňɏssa Pøngjǣrdenlarp Feb 23 '17 at 14:49
  • You should consider creating binary file, notepad can't read them, but you can't just create your own charset. Maybe try to encode it. – Nicolas Feb 23 '17 at 16:41
  • There are many things to consider... If your program code is not secure, securing the data like fort-knox is overkill. Also, if making your data so encrypted shackles your program by making it unreasonably slow than reasonable.. you have gone too far. Generally a decent binary file with any important strings encrypted is sufficient. File should have some form of checksum values though to limit injections. – Trevor_G Feb 23 '17 at 20:09

1 Answers1

1

You're looking for encryption, if you want something readable only to your application but not the end user.

I don't know VB.NET but a quick google search shows me this question which has a pretty well written answer, that seems to explain how to encrypt a file in VB.NET

Community
  • 1
  • 1
Zachary Craig
  • 2,192
  • 4
  • 23
  • 34
  • That basically moves the problem to handling the encryption securely. That said encryption will improve the security by increasing the work factor. – zaph Feb 23 '17 at 16:51
  • Judging by the initial quality and specificity of the original question, I doubt that me writing up an entire thing about how to write a secure program is going to be worth anyones effort, he asked how to write a file only his program can read, this is the closest i can give him without getting way way too specific for the ideal of basic generalized QA this site seems to focus on. – Zachary Craig Feb 23 '17 at 18:51
  • I am not complaing about your answer, just augmenting it. Oftern developers new to encryption overlook that securing the key is hard or impossible. Note the second sentence in my comment. – zaph Feb 23 '17 at 20:23