c# - Unable to convert varchar type to byte[] -
I have the parameters which has33) I have named the password passwordvalid in the database for the password saved to the crypted_password and the salt ( If you want to compare (string, byte [], byte []) string for plaintextpassword, byte [for cryptedpassword saved] and saved salt and crypted_password and salt attributes varchar type are in the database so my question is how I changed the varchar datatype [] so the byte Can I pass passwordisvalid () to do that? Any help would be appreciated. The varchar element should map back to the string from the database. So the question is, how can I get to convert a string into a byte array Take a look at this post: .. It explains how to convert [byte] without using a utf encoding
public static bool isPasswordValid (string passwordPlainText, byte [] savedSaltBytes, byte [] savedHashBytes) {byte [] Array1 = GenerateSaltedHash (passwordPlainText, savedSaltBytes); Byte [] array2 = SavedHashBit; if (array1.Length! = Array2.Length) returns incorrectly; (int i = 0; I & lt; array1.Length; i ++) {if (! Array1 [i] = array2 [i]) return false;} return true;}
Comments
Post a Comment