I have this scenario in a web app which I'm working on its client-side code(I'm building it with ReactJS):
- I obtain user's info
- hash 'em
- send it to the server for being authenticated
- and when I get the result back
- I have to store the password and username locally in the LocalStorage for the further request to other APIs-you see it would be really inconvenient to ask for user's credentials each time while they had logged in before so I have to store 'em- (it is an obligation made by the back-end programmers to ask for the password and username for each request).
So, I'm asking if anyone knows what would be the best solution for this situation? Should I hash 'em or do something completely different? If hashing is the answer, what would be the best hashing algorithm for this matter?