I learn MySQL and PHP through a book in a library. I improved the security of the password encryption system by changing the password store from
password=SHA('password')
to
password=SHA(CONCAT('password', '--', registration_date))
where registration_dateis the timestamp when the user has registered.
Current user registration code:
INSERT INTO users (first_name, last_name, email, password, registration_date)
VALUES ('first_name', 'last_name', 'email', SHA(CONCAT('password', '--', NOW())), NOW());
Will I need to worry about two different NOW () functions? Do they have the opportunity to have a slightly different time? I tried this with a few queries and it seems to be working fine.
If a problem occurs, how would I fix it?
source
share