Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Protect data in c++ source code

I have written a program that connects to a mysql database to authenticate the user using my program.
Everything works fine.
The problem im having is that when I use a decompiler (rec decompiler) its able to get my database details used to login to the server (database, database user, database password) as well as the sql used. A person could easily go and query my database and get a users password.

I dont know whether this helps but i store the database details and querys in strings and char types.

Any help is appreciated.
[556 byte] By [jammesz] at [2007-11-11 11:59:46]
# 1 Re: Protect data in c++ source code
encrypt the important fields in the database (odds are, they could also hack the database file itself and get the same info, without even logging into it!). Your program can encrypt the input and then match *that* mess against the stuff in the database. The beauty here is that the password and name are never decrypted, only the user knows them. The change would likely be that your data fields become unsigned char (or data / bytes) instead of text only.
(char).
jonnin at 2007-11-11 20:55:39 >