Click here to Skip to main content
14,641,358 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi, i have a problem with using XML file to store the username and password for an HTML5 login form. I created the login page but i cannot use the xmlDOM and those things effectively with Javascript to compare the username and password in the xml file with the username and password given by the user to confirm the logging in process. (The XML file is in my local hard disk)

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

I don't know the detail of your scenario and your problem, but is you really want to store a password, no matter where, this is a totally wrong approach. Real authentication systems do not store password, in its original form, anywhere. It is absolutely not needed for authentication; and the password belongs only to the person who created it, no one else. Surprised, feel disagree? Keep reading.

The usual approach i using cryptographic hash function to store it and to compare it with cryptographic hash function of a password. You can compare it, but it's cryptographic infeasible to restore the original password from hash value. For further detail, please see my past answers:
i already encrypt my password but when i log in it gives me an error. how can decrypte it[^],
Decryption of Encrypted Password[^],
storing password value int sql server with secure way[^].

MostafaElbrawy 10-Jun-13 23:17pm
First of all, I am grateful to you for your perfect answer. But i am a very beginner,actually i am a CS student, and (Storing username and password in xml file) is requested as it is from me. i know this is not the perfect way, but i must do it.
Thank You anyway,

Sergey Alexandrovich Kryukov 10-Jun-13 23:41pm
Why "must"? Use a proper way from the very beginning, it's not really harder.
And what's your application type?
MostafaElbrawy 14-Jun-13 10:18am
Thanks SA, You Are The Best :)
Sergey Alexandrovich Kryukov 14-Jun-13 12:27pm
This is just flattering, but thank you.
You and your questions are very welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100