c# - Unable to convert varchar type to byte[] -


"postprint" itemprop = "text">

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?

  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;}   

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

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -