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))); }
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); } }