How do a use a SecureString to create a SHA1 or SHA512 Hash?
I would like to use a SecureString varible within VB.NET and convert that to a SHA1 or SHA512 hash. How would I securely convert the SecureString to the Byte array that HashAlgorithm.ComputeHash will accept? What about that, if we avoid the only used String instance (output) and replace it with a character array. This would enable us to wipe this array after use: public static String SecureStringToMD5( SecureString password ) { int passwordLength = password.Length; char[] passwordChars = new char[passwordLength]; // Copy the password from SecureString to our char array IntPtr passwortPointer =