all. I've set up a file in a winforms project which needs an encrypted string, and i'm using the nuget plugin MirzaCryptoHelpers (here), which is a wrapper for common decryption/encryption methods. I'm trying to decrypt a previously encrypted file, however it is returning a NullException upon attempting to convert the decrypted bytes back to a string.
Here's my method:
StreamReader sr = new StreamReader("C:\file.txt")
encryptedstring = sr.ReadLine();
sr.Close() //finished using reader.
//Converting string to bytes.
byte[] encryptedbytes = BitHelpers.ConvertStringToBytes(encryptedstring);
//Decrypting bytes, returns "null" for unknown reason
byte[] unencryptedbytes = new AESCrypto().Decrypt(encryptedbytes, "pass");
//Error is thrown on the below line:
string finalbytes = BitHelpers.ConvertBytesToString(unencryptedbytes);
What's wrong with my method? Or is it the plugin i'm using?