Пример #1
0
 private void encrypt()
 {
     foreach (byte item in imageByteArray)
     {
         this.encryptCode.Add(new ArrayList(this.table[item]));
     }
     this.encryptedFile = new EncryptedFile(this.table, this.encryptCode);
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
        }