0

I am working in MYSQL and Python. I have a table that stores users login information and want to make this secure. How do I add the salt after the first two characters of the password? I am then going to hash it using sha256.

The table looks like this:

username password salt
test testing123 abc09

I made the table using like this, bit if there is something you can implement here I am happy to redo it.

CREATE TABLE `user` (
  `username` varchar(20) NOT NULL,
  `password` varchar(100) NOT NULL,
  `salt` varchar(100) DEFAULT NULL
);

Later I am going to use python to unhash and retrieve the password.

Maria.A
  • 43
  • 7
  • You do not "unhash" a password, you hash the login input and check it. if you use bcrypt like here, salt is part of the hash result: https://stackoverflow.com/questions/9594125/salt-and-hash-a-password-in-python – ivvija May 13 '22 at 12:06

1 Answers1

0

I found out that it is easier to do this thru python. I hash the password and insert the salt using hashlib.

Maria.A
  • 43
  • 7