hi, can anyone provide me the C code for login in screen.I m using C(borland)compiler and working on xp. The requirments are following- 1.Should accept user name as user-1,user-2 2.Accept password(should not displyed on the screen) 3.A case insenstive coparison is to be done for usname and password. 4.Login name and password are hardcoded in the program and not strored in any file.
4.Login name and password are hardcoded in the program and not strored in any file.
I find this self-contradictory. "Hardcoded" means that password WILL BE stored in program file as embedded string resource. So for added security i suggest to hardcode not plain password, but instead MD5 hash of password. And when user enters password - you will do check md5(password)== hardcoded_md5_of_password . Point is that if something will extract password hash from the executable file - he/she will not find-out password, because md5 hash is one way encryption. (Unless he/she does bruteforce,- generates all possible passwords and compares it's hash with stored one). In any case a way of storing md5 hash is a LOT more secure than storing just plain password. p.s. google MD5,- there a a lot of md5 implementations in C. good luck