示例#1
0
文件: Files.cs 项目: Achimeir/RFAS-
        public override void Encrypt(byte[] key, byte[] iv, string encryptData = null)
        {
            string temppic  = Path.GetTempPath() + "temp" + Path.GetExtension(filePath);
            Image  imgInput = Image.FromFile(this.filePath);

            imgInput = (Image)SteganographyWrapper.HideTextInImage(encryptData, (Bitmap)imgInput);
            imgInput.Save(temppic);
            imgInput.Dispose();

            System.IO.File.Delete(filePath);
            System.IO.File.Copy(temppic, filePath);
        }
示例#2
0
文件: Files.cs 项目: Achimeir/RFAS-
 public override void Decrypt(byte[] key, byte[] iv)
 {
     try
     {
         Image imgInput = Image.FromFile(this.filePath);
         System.Windows.Forms.MessageBox.Show(":הטקסט שהוצפן הוא" + System.Environment.NewLine + SteganographyWrapper.ExtractTextFromImage((Bitmap)imgInput), "פיענוח הצפנה");
         imgInput.Dispose();
     }
     catch (Exception e)
     {
         System.Windows.Forms.MessageBox.Show(e.Message + " הפענוח נכשל מהסיבה", "תקלה", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
     }
 }