I have list of user's password (password Salt and password Hash ) saved in DB table. The password is not saved anywhere.
var hmac = new HMACSHA512();
var newUser = new Users
{
UserName = userName.ToLower(),
CreatedDate = DateTime.UtcNow,
CreatedBy = User.Identity.Name,
PasswordHash = hmac.ComputeHash(Encoding.UTF8.GetBytes(pwd)),
PasswordSalt = hmac.Key
};
_dbContext.Users.Add(newUser);
_dbContext.SaveChanges();
I need to display the password for each of the user only when needed. Say when we click on particular user with show password button by passing user ID.