Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Any example for 3 Months Validity of password in c++. Am able to check strength of the password

What I have tried:

New to password management system. Dont know how to validate.
Posted
Updated 7-Mar-19 0:09am
v2

What you need to do is store an "expiry date" in your DB along with the password. When the user signs or changes his password up you set it to the current date plus the validity period - 3 months in this case.
When the user logs in, you check the expiry date, and behave appropriately.

But ... it may be a very poor idea to bother adding this feature as it provides no significant increase in security, and can actually lower real security while falsely raising the impression of security: Time for Password Expiration to Die | SANS Security Awareness[^]

Much more important is how you store a password than how long it lasts!
 
Share this answer
 
Storing a password is a bit of an art, you should use some "salt" and "pepper" and only store some SHA-2 or better hash.

So it would better to store only an expiration day with the user name in some database.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900