in reply to Binary config file suggestions

This sounds like a sys admin problem. I don't know what O/S you are on, but even on MS there are ways to allow execute, but not read permissions. This is very easy to do on a *nix platform. If the "bad", but not so "bad" guys have read access to the source code, then I would say "game over".

If this is some sort of user config file that you want to be controlled by your program (and only modified by your program), then that is different. Leave the file in plain text and put a fancy "checksum" at the end. Lots of ways to do that. Program doesn't run if "checksum" doesn't jive. Your program controls encryption keys and algorithm to generate the "checksum".

Replies are listed 'Best First'.
Re^2: Binary config file suggestions
by GrandFather (Saint) on Mar 12, 2009 at 19:07 UTC

    A simple, and for this purpose probably sufficiently robust, way to provide a 'checksum' is to use the MD5 of the original text concatenated with some seed text. In fact if the seed text is the source for the program you can check both the program and the config file for tampering.


    True laziness is hard work
Re^2: Binary config file suggestions
by almut (Canon) on Mar 12, 2009 at 18:11 UTC
    there are ways to allow execute, but not read permissions. This is very easy to do on a *nix platform.

    It might be worth noting that this only works with binary (compiled) programs, but not with scripts. Reason is that the script interpreter would need to be able to read the source... In other words, if the app is in Perl, its source cannot be "hidden" using this technique.