Im making a little App in WPF 3.5 to store Passwords and im very nearly done, however the final thing I want to add is some Encryption to Files that are written just to make it a little harder to read as Binary adds lots of woffle but doesn't acturally conceal much of the data.
As mentioned im using a pretty standard Binary Serilization and Deserialization function and got that working (again another 'first' for me) and having done some searching Ive realised I need to use a CryptoStream
, however unless im not really understanding the code in the examples ive come across, they do not combine it with serialization/de-serializa
tion, before writing or reading the files.
The only example I thought would help acturaly mixes Encryption with XML serialisation so using that as a basis ive tried the following.
public void WritePasswordDetails(List<PassDetails> passwords, string Refname, SymmetricAlgorithm Key)
IFormatter formatter = new BinaryFormatter();
using (Stream dataFileStream = File.Create(Refname))
using(CryptoStream cs = new CryptoStream(dataFileStream, Key.CreateDecryptor(), CryptoStreamMode.Write))
This code throws no errors in itself. However the Code im using to Write this data is, due to it only taking two Arguements:-
WritePasswordDetails(passwordlist, (user) +".dat");
Error 1 No overload for method 'WritePasswordDetails' takes 2 arguments
How do I go about fixing this problem and implimenting this properly?