i am working on an encryption and decryption application using visual studio c#, my encryption and decryption of text works but i am trying to add a password for the text when encrypted and for the application to ask for a password when decrypting the text, as in the user gets to input a custom password when encrypting and when decrypting the user gets to input the password and text decrypts.
using System.Security.Cryptography;
public static string EncodePasswordToBase64(string password)
{ byte[] bytes = Encoding.Unicode.GetBytes(password);
byte[] inArray = HashAlgorithm.Create("SHA1").ComputeHash(bytes);
return Convert.ToBase64String(inArray);
}