fcjr4869 wrote:
Really useful and easy-to-learn tutorial. I followed all of your tips here and applied them in my current project. I have a question though on Forgotten Passwords.
My project is OFFLINE - units are connected only thru LAN - so I cannot use the Send to Email approach.
One solution I can think of is allow the Administrator to see user details such as names, usernames, and passwords.
Another is to send notifications to the client unit thru LAN. But I'm still a novice to PHP,Javascript and others so I don't know how to do it.
So how do I decrypt or un-hash the passwords so I can echo it in a textfield?
Any advice or suggestions will be much appreciated..
Thanks in advance!!!

I'm glad that you were able to use the information in the tutorial and apply it to your project.
So my first comment is that, in your local network deployment, you are less vulnerable to outside hackers, including botnets and other mass attacks. Still, I understand that you want a system that is secure. One principle is that you never decrypt or unhash passwords! When validating a user, you ALWAYS hash or encrypt whatever the user has entered, then compare that with the stored (hashed) value--it either matches or it doesn't. Even the system administrator has no ability to decode a stored password and see what the plaintext version is. That's why, when a password is forgotten, you cannot inform a user what their password is, you must ALWAYS replace it with a NEW password, either a random one which you generate and send the plaintext to the user in an email (perhaps impractical in your case) or you require the user to generate their own NEW password. If it were me, I think I would apply the same rules to a closed LAN system, but I suppose in some circumstances it might be reasonable to design a semi-secure system where passwords were encoded by an algorithm that is reversible, just to make it difficult for others to decode, but allowing the system or its administrators to recover them. I would only do that, however, if the data in the system wasn't "sensitive" and the potential harm that might result from a compromised account is really low.
If you decide that you do want to have a reasonably secure LAN system, and you don't have an internal email system, you might consider alternatives like requiring any user who has forgotten their password to apply in person to the system administrator, who would then issue a new password, using a script that is not accessible to users, or something like that.