Beispiel #1
0
        public bool EditBlackList(byte[] crypted)
        {
            try
            {
                List <Restriction> newBlackList = (List <Restriction>)AesAlg.Decrypt(crypted, sessionKeys[Formatter.ParseName(Thread.CurrentPrincipal.Identity.Name)]);
                Restriction.WriteBlackList(newBlackList);

                string checksum  = checkMD5("Blacklist.xml");
                byte[] ba        = Encoding.Default.GetBytes(checksum);
                string hexString = BitConverter.ToString(ba);
                writeInTxt(hexString);
                return(true);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: " + e.Message);
                return(false);
            }
        }