Question

I'm trying to create a new file extension for a software I'm developing, all I want to do is to create a text file (for storing data) which will be encrypted to bytes or something like that, so if the user tries to edit it, it won't be editable.

  1. Do I need any library to perform an action like that?
  2. Can I guarantee no one could read that?
  3. Are there any other ways of storing data on the system? (only readable by the software)
Était-ce utile?

La solution

Something like this may be helpful here. This is an example for encrypting a String into an encrypted format. If you were able to get the content you wanted in the file in a string format, then encrypt it similarly to the way shown in the link, then output that to your file. That way when the file is opened they will merely have encrypted info (or to the untrained eye, a load of gobeldy goop).

As far as I know all file extensions are able to be opened in some format or the other, even if you have to resort to a low level application like notepad, so your best bet is to scramble the info inside the file.

Hope this helps!

Autres conseils

You need some library to encrypt and decrypt data (like the one user2777005 mentioned).

Then you need to think about the key for encryption. The key can be a password for example, that the users of your application enter.

If the key does not come from the user (e.g. your application just silently encrypts and decrypts the file), you need to store that key in a way that no one can simply access. A possible place to store such a key is the windows registry. In that case you would create a key when you install your application on the target computer.

But if a level of protection, that does not allows a user to open an editor and read the file, is enough for you, you can simply hard code the key into your software. This of course means, that a medium skilled hacker can read the file.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top