private void encrypt() { foreach (byte item in imageByteArray) { this.encryptCode.Add(new ArrayList(this.table[item])); } this.encryptedFile = new EncryptedFile(this.table, this.encryptCode); }
public EncryptedFile deserialize(string Path) { BinaryFormatter Serializer = new BinaryFormatter(); using (FileStream fs = new FileStream(Path, FileMode.OpenOrCreate)) { EncryptedFile encrypted = (EncryptedFile)Serializer.Deserialize(fs); return(encrypted); } }
public ArrayList decrypt(EncryptedFile encrypted) { ArrayList decrypt = new ArrayList(); foreach (ArrayList item in encrypted.encodedCode) { foreach (KeyValuePair <byte?, ArrayList> item1 in encrypted.decodeTable) { if (item.ToArray().SequenceEqual(item1.Value.ToArray())) { decrypt.Add(item1.Key); } } } return(decrypt); }