I am attempting to create my first login page as a learning exercise.
My plan was to pre hash the password using a salt of the username for example. Store that in a text file and then when when the user logs in i would hash the password using the same salt and compare the results to the text file.
I am a complete beginner with security etc so i dont know if this would be secure or not? What is the norm for small applications? if this method isnt recommended, what is a suitable simple alternative?
EDIT One possible solution if i can get it to work.
String unpwfield;
unpwfield = userId.getText()+passwordfield.getText();
if (BCrypt.checkpw(unpwfield, passwordhash))
System.out.println("It matches");
else
System.out.println(userId.getText()+passwordfield.getText());