Пример #1
0
        public static void Signing(File f)
        {
            string filehash = Cryptfunc.GetHash(Cryptfunc.AESDecrypt(System.IO.File.ReadAllBytes(f.pathtofile)));
            string logshash = Cryptfunc.GetHash(Cryptfunc.AESDecrypt(System.IO.File.ReadAllBytes(f.pathtolog)));
            string strout   = filehash + " -- " + logshash;

            System.IO.File.WriteAllBytes(f.pathtosign, Cryptfunc.RSAEncrypt(System.Text.Encoding.Default.GetBytes(strout)));
        }
Пример #2
0
 public bool IsLogValid()
 {
     if (this.IsSigExist() && this.IsLogsExist())
     {
         string filehash = Cryptfunc.GetHash(Cryptfunc.AESDecrypt(System.IO.File.ReadAllBytes(this.pathtolog)));
         if (this.loghashfromsig == filehash)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }