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.

9 Years
Discussion Span
Last Post by dij_0983

We're not here to do your homework for you. If you want help, you'll have to make an honest attempt at solving the problem and then ask a specific question.


ya...i can do...but it requires a file to store the user data...

Welcome to the forum, Snivas!

As for the file being needed - <wink> <wink> I KNOW you were joking.

Please God, that's all I ask for today, let Snivas be enjoying zee little joke. ;)


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.
google MD5,- there a a lot of md5 implementations in C.
good luck


check in below link for accepting password(according to your requirement) in C

Edited by Nick Evan: Removed plug


This is a very old thread from 2009.

If you have a current problem like this, please start a new thread, and don't add to this one.

The "zombie's" need their rest. ;)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.