Click here to Skip to main content
15,895,256 members

Comments by HKHerron (Top 46 by date)

HKHerron 4-Sep-17 15:10pm View    
I Agree, I did state that this is not a secure approach.

However, I did mention using a Server-Side solution that would preform this function on the server instead, then reply back to the application if the keycode is valid or not.

I do have a couple of question for you though (Nothing to do with security)
How are you planning to maintain the database?
Are you going to add a new keycode every time you give out another copy?
What type of web-server are you running? Is it Public?
HKHerron 3-Sep-17 18:25pm View    
OK, there are some things you need to change for it to work correctly.

For example, the namespace should match your application.
HKHerron 3-Sep-17 17:14pm View    
There are several different ways you can handle the connection string.
Unfortunately, it is required to connect to any MySql database.

The text file was just a SIMPLE way to demonstrate.
I use the Text file version, because I use this in several applications and they connect to different servers. This way I can use the same code, and the only thing that changes is my DBConfig file. This is not considered Hard Coded, as it loads the information from the DBConfig file each time the application is ran. And yes, this is not very secure. However, to make the text file more secure, you could encrypt the text file. Then Decrypt in code to read the information.

You could also make it part of the Install application, hard code it in to the Initialize() method, then have it saved anywhere, and in any form. Once you application is complied, it is a lot harder to find the information.

One other way would be to create a Web App that does the MySql side of things, so that the connection string is actually on the web server and not in your code.

for example, write a web page:
http://www.mysite.com/CheckKeyCode?a1b2c3d4e5f6g7h8i9j10k11

Have it do the same work that in my code, then return a blank page with either the work true or false.

We then change my code to run an httprequest with the keycode entered, then read the response. Then perform actions based on the True or False reply.



One last thing, I forgot to mention, create a different user for the database to use other than your main account or the Admin account. Then only give the user rights to Query and Update.
HKHerron 10-Mar-16 16:02pm View    
PHP with MySQL is what I would suggest. However, It appears you need to learn more about coding languages and what their abilities are. Also, you could down load an open source project, and study the code.
HKHerron 31-Dec-15 16:47pm View    
You need to submit more code here for us to evaluate.
We can not solve your issue from what you have presented.