I have a project in which we need to transfer many users who have their password in plain text to a new database, where we will enter the password.
The new system uses the Entity Framework and needs to be authenticated using the Identity Asp.Net infrastructure.
I found that I can generate the correct hashed password in C #, which the Entity Framework can read without problems.
public static string HashPassword(string password) { byte[] salt; byte[] buffer2; using (var bytes = new Rfc2898DeriveBytes(password, 0x10, 0x3e8)) { salt = bytes.Salt; buffer2 = bytes.GetBytes(0x20); } byte[] dst = new byte[0x31]; Buffer.BlockCopy(salt, 0, dst, 1, 0x10); Buffer.BlockCopy(buffer2, 0, dst, 0x11, 0x20); return Convert.ToBase64String(dst); }
Is there something similar in SQL that I could use in an INSERT statement from SELECT to another table?
source share