Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

password program

sylvesterlpsylvesterlp Posts: 7Member
im writin a small security system program. its somethin like the password thing. once the user has entered the information and a password, the information will only display again after he enters the password again. i have no clue of howto do it. does anyone can help me?

Comments

  • zibadianzibadian Posts: 6,349Member
    : im writin a small security system program. its somethin like the password thing. once the user has entered the information and a password, the information will only display again after he enters the password again. i have no clue of howto do it. does anyone can help me?
    :
    There are a few ways of writing such a program. First and easiest way is to store the password, along with the data and if the user requests the data, use a simple if-then statement to check the password and if correct show the data.
    The second way is to use an encryption method. This requires a small addition to the data to validate the password. If a user accesses the data, ask for the password, decrypt the validation part of the data. Once the password is validated (ie if the decrypted validation part matches the unencrypted validation part) decrypt the data and show it. This is somewhat more work and is more secure than the previous one, but still has quite a hole in it.
    The last way I want to mention, is simply to encrypt the data using the password. If a user accesses the data decrypt it, and show the decrypted data, no matter if the password was correct or not. If the password was incorrect the user sees rubbish.
Sign In or Register to comment.