From bf839389574068d8a1072864c0d3f7d1fc795d76 Mon Sep 17 00:00:00 2001 From: Gavin Kendall Date: Mon, 31 Jan 2022 09:34:10 -0500 Subject: [PATCH] 2.4.0.0 - Fixed the encryption and decryption of files functionality. Added some checks to make sure that we're not using values from empty fields. History added to "File" tab for keeping history of what file was encrypted and decrypted. Keyboard Shortcuts re-arranged. --- interface/setup/FormSetup.Designer.cs | 56 ++++++------- .../tools/FormEncryptorDecryptor.Designer.cs | 60 ++++++++++---- interface/tools/FormEncryptorDecryptor.cs | 81 ++++++++++++++++++- 3 files changed, 150 insertions(+), 47 deletions(-) diff --git a/interface/setup/FormSetup.Designer.cs b/interface/setup/FormSetup.Designer.cs index 15d1b756..8a1e2e34 100644 --- a/interface/setup/FormSetup.Designer.cs +++ b/interface/setup/FormSetup.Designer.cs @@ -1363,7 +1363,7 @@ private void InitializeComponent() // labelRegionSelectEdit // this.labelRegionSelectEdit.AutoSize = true; - this.labelRegionSelectEdit.Location = new System.Drawing.Point(200, 225); + this.labelRegionSelectEdit.Location = new System.Drawing.Point(43, 209); this.labelRegionSelectEdit.Name = "labelRegionSelectEdit"; this.labelRegionSelectEdit.Size = new System.Drawing.Size(223, 13); this.labelRegionSelectEdit.TabIndex = 37; @@ -1372,7 +1372,7 @@ private void InitializeComponent() // labelStopScreenCapture // this.labelStopScreenCapture.AutoSize = true; - this.labelStopScreenCapture.Location = new System.Drawing.Point(200, 90); + this.labelStopScreenCapture.Location = new System.Drawing.Point(43, 74); this.labelStopScreenCapture.Name = "labelStopScreenCapture"; this.labelStopScreenCapture.Size = new System.Drawing.Size(106, 13); this.labelStopScreenCapture.TabIndex = 13; @@ -1380,7 +1380,7 @@ private void InitializeComponent() // // textBoxKeyboardShortcutRegionSelectEditKey // - this.textBoxKeyboardShortcutRegionSelectEditKey.Location = new System.Drawing.Point(624, 222); + this.textBoxKeyboardShortcutRegionSelectEditKey.Location = new System.Drawing.Point(467, 206); this.textBoxKeyboardShortcutRegionSelectEditKey.MaxLength = 1; this.textBoxKeyboardShortcutRegionSelectEditKey.Name = "textBoxKeyboardShortcutRegionSelectEditKey"; this.textBoxKeyboardShortcutRegionSelectEditKey.Size = new System.Drawing.Size(40, 20); @@ -1390,7 +1390,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutRegionSelectClipboardModifier1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutRegionSelectClipboardModifier1.FormattingEnabled = true; - this.comboBoxKeyboardShortcutRegionSelectClipboardModifier1.Location = new System.Drawing.Point(438, 168); + this.comboBoxKeyboardShortcutRegionSelectClipboardModifier1.Location = new System.Drawing.Point(281, 152); this.comboBoxKeyboardShortcutRegionSelectClipboardModifier1.Name = "comboBoxKeyboardShortcutRegionSelectClipboardModifier1"; this.comboBoxKeyboardShortcutRegionSelectClipboardModifier1.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutRegionSelectClipboardModifier1.TabIndex = 30; @@ -1398,7 +1398,7 @@ private void InitializeComponent() // labelStartScreenCapture // this.labelStartScreenCapture.AutoSize = true; - this.labelStartScreenCapture.Location = new System.Drawing.Point(200, 63); + this.labelStartScreenCapture.Location = new System.Drawing.Point(43, 47); this.labelStartScreenCapture.Name = "labelStartScreenCapture"; this.labelStartScreenCapture.Size = new System.Drawing.Size(106, 13); this.labelStartScreenCapture.TabIndex = 9; @@ -1408,7 +1408,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutRegionSelectEditModifier2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutRegionSelectEditModifier2.FormattingEnabled = true; - this.comboBoxKeyboardShortcutRegionSelectEditModifier2.Location = new System.Drawing.Point(531, 222); + this.comboBoxKeyboardShortcutRegionSelectEditModifier2.Location = new System.Drawing.Point(374, 206); this.comboBoxKeyboardShortcutRegionSelectEditModifier2.Name = "comboBoxKeyboardShortcutRegionSelectEditModifier2"; this.comboBoxKeyboardShortcutRegionSelectEditModifier2.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutRegionSelectEditModifier2.TabIndex = 39; @@ -1417,7 +1417,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutRegionSelectClipboardModifier2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutRegionSelectClipboardModifier2.FormattingEnabled = true; - this.comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Location = new System.Drawing.Point(531, 168); + this.comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Location = new System.Drawing.Point(374, 152); this.comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Name = "comboBoxKeyboardShortcutRegionSelectClipboardModifier2"; this.comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutRegionSelectClipboardModifier2.TabIndex = 31; @@ -1426,7 +1426,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutStartScreenCaptureModifier1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutStartScreenCaptureModifier1.FormattingEnabled = true; - this.comboBoxKeyboardShortcutStartScreenCaptureModifier1.Location = new System.Drawing.Point(438, 60); + this.comboBoxKeyboardShortcutStartScreenCaptureModifier1.Location = new System.Drawing.Point(281, 44); this.comboBoxKeyboardShortcutStartScreenCaptureModifier1.Name = "comboBoxKeyboardShortcutStartScreenCaptureModifier1"; this.comboBoxKeyboardShortcutStartScreenCaptureModifier1.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutStartScreenCaptureModifier1.TabIndex = 10; @@ -1435,7 +1435,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutRegionSelectEditModifier1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutRegionSelectEditModifier1.FormattingEnabled = true; - this.comboBoxKeyboardShortcutRegionSelectEditModifier1.Location = new System.Drawing.Point(438, 222); + this.comboBoxKeyboardShortcutRegionSelectEditModifier1.Location = new System.Drawing.Point(281, 206); this.comboBoxKeyboardShortcutRegionSelectEditModifier1.Name = "comboBoxKeyboardShortcutRegionSelectEditModifier1"; this.comboBoxKeyboardShortcutRegionSelectEditModifier1.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutRegionSelectEditModifier1.TabIndex = 38; @@ -1443,7 +1443,7 @@ private void InitializeComponent() // labelCaptureNowEdit // this.labelCaptureNowEdit.AutoSize = true; - this.labelCaptureNowEdit.Location = new System.Drawing.Point(200, 144); + this.labelCaptureNowEdit.Location = new System.Drawing.Point(43, 128); this.labelCaptureNowEdit.Name = "labelCaptureNowEdit"; this.labelCaptureNowEdit.Size = new System.Drawing.Size(98, 13); this.labelCaptureNowEdit.TabIndex = 21; @@ -1451,7 +1451,7 @@ private void InitializeComponent() // // textBoxKeyboardShortcutRegionSelectClipboardKey // - this.textBoxKeyboardShortcutRegionSelectClipboardKey.Location = new System.Drawing.Point(624, 168); + this.textBoxKeyboardShortcutRegionSelectClipboardKey.Location = new System.Drawing.Point(467, 152); this.textBoxKeyboardShortcutRegionSelectClipboardKey.MaxLength = 1; this.textBoxKeyboardShortcutRegionSelectClipboardKey.Name = "textBoxKeyboardShortcutRegionSelectClipboardKey"; this.textBoxKeyboardShortcutRegionSelectClipboardKey.Size = new System.Drawing.Size(40, 20); @@ -1459,7 +1459,7 @@ private void InitializeComponent() // // textBoxKeyboardShortcutStopScreenCaptureKey // - this.textBoxKeyboardShortcutStopScreenCaptureKey.Location = new System.Drawing.Point(624, 87); + this.textBoxKeyboardShortcutStopScreenCaptureKey.Location = new System.Drawing.Point(467, 71); this.textBoxKeyboardShortcutStopScreenCaptureKey.MaxLength = 1; this.textBoxKeyboardShortcutStopScreenCaptureKey.Name = "textBoxKeyboardShortcutStopScreenCaptureKey"; this.textBoxKeyboardShortcutStopScreenCaptureKey.Size = new System.Drawing.Size(40, 20); @@ -1468,7 +1468,7 @@ private void InitializeComponent() // labelRegionSelectAutoSave // this.labelRegionSelectAutoSave.AutoSize = true; - this.labelRegionSelectAutoSave.Location = new System.Drawing.Point(200, 198); + this.labelRegionSelectAutoSave.Location = new System.Drawing.Point(43, 182); this.labelRegionSelectAutoSave.Name = "labelRegionSelectAutoSave"; this.labelRegionSelectAutoSave.Size = new System.Drawing.Size(194, 13); this.labelRegionSelectAutoSave.TabIndex = 33; @@ -1477,7 +1477,7 @@ private void InitializeComponent() // labelCaptureNowArchive // this.labelCaptureNowArchive.AutoSize = true; - this.labelCaptureNowArchive.Location = new System.Drawing.Point(200, 117); + this.labelCaptureNowArchive.Location = new System.Drawing.Point(43, 101); this.labelCaptureNowArchive.Name = "labelCaptureNowArchive"; this.labelCaptureNowArchive.Size = new System.Drawing.Size(116, 13); this.labelCaptureNowArchive.TabIndex = 17; @@ -1486,7 +1486,7 @@ private void InitializeComponent() // labelRegionSelectClipboard // this.labelRegionSelectClipboard.AutoSize = true; - this.labelRegionSelectClipboard.Location = new System.Drawing.Point(200, 171); + this.labelRegionSelectClipboard.Location = new System.Drawing.Point(43, 155); this.labelRegionSelectClipboard.Name = "labelRegionSelectClipboard"; this.labelRegionSelectClipboard.Size = new System.Drawing.Size(133, 13); this.labelRegionSelectClipboard.TabIndex = 29; @@ -1494,7 +1494,7 @@ private void InitializeComponent() // // textBoxKeyboardShortcutRegionSelectAutoSaveKey // - this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.Location = new System.Drawing.Point(624, 195); + this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.Location = new System.Drawing.Point(467, 179); this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.MaxLength = 1; this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.Name = "textBoxKeyboardShortcutRegionSelectAutoSaveKey"; this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.Size = new System.Drawing.Size(40, 20); @@ -1504,7 +1504,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutStartScreenCaptureModifier2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutStartScreenCaptureModifier2.FormattingEnabled = true; - this.comboBoxKeyboardShortcutStartScreenCaptureModifier2.Location = new System.Drawing.Point(531, 60); + this.comboBoxKeyboardShortcutStartScreenCaptureModifier2.Location = new System.Drawing.Point(374, 44); this.comboBoxKeyboardShortcutStartScreenCaptureModifier2.Name = "comboBoxKeyboardShortcutStartScreenCaptureModifier2"; this.comboBoxKeyboardShortcutStartScreenCaptureModifier2.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutStartScreenCaptureModifier2.TabIndex = 11; @@ -1513,7 +1513,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.FormattingEnabled = true; - this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Location = new System.Drawing.Point(438, 195); + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Location = new System.Drawing.Point(281, 179); this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Name = "comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1"; this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.TabIndex = 34; @@ -1522,7 +1522,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutStopScreenCaptureModifier2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutStopScreenCaptureModifier2.FormattingEnabled = true; - this.comboBoxKeyboardShortcutStopScreenCaptureModifier2.Location = new System.Drawing.Point(531, 87); + this.comboBoxKeyboardShortcutStopScreenCaptureModifier2.Location = new System.Drawing.Point(374, 71); this.comboBoxKeyboardShortcutStopScreenCaptureModifier2.Name = "comboBoxKeyboardShortcutStopScreenCaptureModifier2"; this.comboBoxKeyboardShortcutStopScreenCaptureModifier2.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutStopScreenCaptureModifier2.TabIndex = 15; @@ -1531,14 +1531,14 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.FormattingEnabled = true; - this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Location = new System.Drawing.Point(531, 195); + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Location = new System.Drawing.Point(374, 179); this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Name = "comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2"; this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.TabIndex = 35; // // textBoxKeyboardShortcutCaptureNowEditKey // - this.textBoxKeyboardShortcutCaptureNowEditKey.Location = new System.Drawing.Point(624, 141); + this.textBoxKeyboardShortcutCaptureNowEditKey.Location = new System.Drawing.Point(467, 125); this.textBoxKeyboardShortcutCaptureNowEditKey.MaxLength = 1; this.textBoxKeyboardShortcutCaptureNowEditKey.Name = "textBoxKeyboardShortcutCaptureNowEditKey"; this.textBoxKeyboardShortcutCaptureNowEditKey.Size = new System.Drawing.Size(40, 20); @@ -1546,7 +1546,7 @@ private void InitializeComponent() // // textBoxKeyboardShortcutStartScreenCaptureKey // - this.textBoxKeyboardShortcutStartScreenCaptureKey.Location = new System.Drawing.Point(624, 60); + this.textBoxKeyboardShortcutStartScreenCaptureKey.Location = new System.Drawing.Point(467, 44); this.textBoxKeyboardShortcutStartScreenCaptureKey.MaxLength = 1; this.textBoxKeyboardShortcutStartScreenCaptureKey.Name = "textBoxKeyboardShortcutStartScreenCaptureKey"; this.textBoxKeyboardShortcutStartScreenCaptureKey.Size = new System.Drawing.Size(40, 20); @@ -1556,7 +1556,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutStopScreenCaptureModifier1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutStopScreenCaptureModifier1.FormattingEnabled = true; - this.comboBoxKeyboardShortcutStopScreenCaptureModifier1.Location = new System.Drawing.Point(438, 87); + this.comboBoxKeyboardShortcutStopScreenCaptureModifier1.Location = new System.Drawing.Point(281, 71); this.comboBoxKeyboardShortcutStopScreenCaptureModifier1.Name = "comboBoxKeyboardShortcutStopScreenCaptureModifier1"; this.comboBoxKeyboardShortcutStopScreenCaptureModifier1.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutStopScreenCaptureModifier1.TabIndex = 14; @@ -1575,7 +1575,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutCaptureNowEditModifier2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutCaptureNowEditModifier2.FormattingEnabled = true; - this.comboBoxKeyboardShortcutCaptureNowEditModifier2.Location = new System.Drawing.Point(531, 141); + this.comboBoxKeyboardShortcutCaptureNowEditModifier2.Location = new System.Drawing.Point(374, 125); this.comboBoxKeyboardShortcutCaptureNowEditModifier2.Name = "comboBoxKeyboardShortcutCaptureNowEditModifier2"; this.comboBoxKeyboardShortcutCaptureNowEditModifier2.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutCaptureNowEditModifier2.TabIndex = 23; @@ -1584,14 +1584,14 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutCaptureNowEditModifier1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutCaptureNowEditModifier1.FormattingEnabled = true; - this.comboBoxKeyboardShortcutCaptureNowEditModifier1.Location = new System.Drawing.Point(438, 141); + this.comboBoxKeyboardShortcutCaptureNowEditModifier1.Location = new System.Drawing.Point(281, 125); this.comboBoxKeyboardShortcutCaptureNowEditModifier1.Name = "comboBoxKeyboardShortcutCaptureNowEditModifier1"; this.comboBoxKeyboardShortcutCaptureNowEditModifier1.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutCaptureNowEditModifier1.TabIndex = 22; // // textBoxKeyboardShortcutCaptureNowArchiveKey // - this.textBoxKeyboardShortcutCaptureNowArchiveKey.Location = new System.Drawing.Point(624, 114); + this.textBoxKeyboardShortcutCaptureNowArchiveKey.Location = new System.Drawing.Point(467, 98); this.textBoxKeyboardShortcutCaptureNowArchiveKey.MaxLength = 1; this.textBoxKeyboardShortcutCaptureNowArchiveKey.Name = "textBoxKeyboardShortcutCaptureNowArchiveKey"; this.textBoxKeyboardShortcutCaptureNowArchiveKey.Size = new System.Drawing.Size(40, 20); @@ -1601,7 +1601,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutCaptureNowArchiveModifier1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutCaptureNowArchiveModifier1.FormattingEnabled = true; - this.comboBoxKeyboardShortcutCaptureNowArchiveModifier1.Location = new System.Drawing.Point(438, 114); + this.comboBoxKeyboardShortcutCaptureNowArchiveModifier1.Location = new System.Drawing.Point(281, 98); this.comboBoxKeyboardShortcutCaptureNowArchiveModifier1.Name = "comboBoxKeyboardShortcutCaptureNowArchiveModifier1"; this.comboBoxKeyboardShortcutCaptureNowArchiveModifier1.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutCaptureNowArchiveModifier1.TabIndex = 18; @@ -1610,7 +1610,7 @@ private void InitializeComponent() // this.comboBoxKeyboardShortcutCaptureNowArchiveModifier2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxKeyboardShortcutCaptureNowArchiveModifier2.FormattingEnabled = true; - this.comboBoxKeyboardShortcutCaptureNowArchiveModifier2.Location = new System.Drawing.Point(531, 114); + this.comboBoxKeyboardShortcutCaptureNowArchiveModifier2.Location = new System.Drawing.Point(374, 98); this.comboBoxKeyboardShortcutCaptureNowArchiveModifier2.Name = "comboBoxKeyboardShortcutCaptureNowArchiveModifier2"; this.comboBoxKeyboardShortcutCaptureNowArchiveModifier2.Size = new System.Drawing.Size(87, 21); this.comboBoxKeyboardShortcutCaptureNowArchiveModifier2.TabIndex = 19; diff --git a/interface/tools/FormEncryptorDecryptor.Designer.cs b/interface/tools/FormEncryptorDecryptor.Designer.cs index f4361e65..035723a5 100644 --- a/interface/tools/FormEncryptorDecryptor.Designer.cs +++ b/interface/tools/FormEncryptorDecryptor.Designer.cs @@ -62,6 +62,8 @@ private void InitializeComponent() this.labelTextHelp = new System.Windows.Forms.Label(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.listBoxHistory = new System.Windows.Forms.ListBox(); + this.labelHistory = new System.Windows.Forms.Label(); this.tabControl.SuspendLayout(); this.tabPageScreenshots.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewScreenshots)).BeginInit(); @@ -109,7 +111,7 @@ private void InitializeComponent() // labelFilter // this.labelFilter.AutoSize = true; - this.labelFilter.Location = new System.Drawing.Point(652, 27); + this.labelFilter.Location = new System.Drawing.Point(8, 27); this.labelFilter.Name = "labelFilter"; this.labelFilter.Size = new System.Drawing.Size(32, 13); this.labelFilter.TabIndex = 40; @@ -123,7 +125,7 @@ private void InitializeComponent() this.comboBoxFilterValue.Enabled = false; this.comboBoxFilterValue.FormattingEnabled = true; this.comboBoxFilterValue.IntegralHeight = false; - this.comboBoxFilterValue.Location = new System.Drawing.Point(749, 43); + this.comboBoxFilterValue.Location = new System.Drawing.Point(105, 43); this.comboBoxFilterValue.Name = "comboBoxFilterValue"; this.comboBoxFilterValue.Size = new System.Drawing.Size(88, 21); this.comboBoxFilterValue.TabIndex = 39; @@ -142,7 +144,7 @@ private void InitializeComponent() "Label", "Process Name", "Window Title"}); - this.comboBoxFilterType.Location = new System.Drawing.Point(655, 43); + this.comboBoxFilterType.Location = new System.Drawing.Point(11, 43); this.comboBoxFilterType.Name = "comboBoxFilterType"; this.comboBoxFilterType.Size = new System.Drawing.Size(88, 21); this.comboBoxFilterType.TabIndex = 38; @@ -152,7 +154,7 @@ private void InitializeComponent() // dateTimePickerScreenshotsEndTimeRange // this.dateTimePickerScreenshotsEndTimeRange.Format = System.Windows.Forms.DateTimePickerFormat.Time; - this.dateTimePickerScreenshotsEndTimeRange.Location = new System.Drawing.Point(539, 43); + this.dateTimePickerScreenshotsEndTimeRange.Location = new System.Drawing.Point(745, 43); this.dateTimePickerScreenshotsEndTimeRange.Name = "dateTimePickerScreenshotsEndTimeRange"; this.dateTimePickerScreenshotsEndTimeRange.ShowUpDown = true; this.dateTimePickerScreenshotsEndTimeRange.Size = new System.Drawing.Size(92, 20); @@ -162,7 +164,7 @@ private void InitializeComponent() // dateTimePickerScreenshotsStartTimeRange // this.dateTimePickerScreenshotsStartTimeRange.Format = System.Windows.Forms.DateTimePickerFormat.Time; - this.dateTimePickerScreenshotsStartTimeRange.Location = new System.Drawing.Point(217, 43); + this.dateTimePickerScreenshotsStartTimeRange.Location = new System.Drawing.Point(441, 43); this.dateTimePickerScreenshotsStartTimeRange.Name = "dateTimePickerScreenshotsStartTimeRange"; this.dateTimePickerScreenshotsStartTimeRange.ShowUpDown = true; this.dateTimePickerScreenshotsStartTimeRange.Size = new System.Drawing.Size(92, 20); @@ -196,8 +198,8 @@ private void InitializeComponent() this.labelScreenshotsHelp.Name = "labelScreenshotsHelp"; this.labelScreenshotsHelp.Size = new System.Drawing.Size(833, 17); this.labelScreenshotsHelp.TabIndex = 34; - this.labelScreenshotsHelp.Text = "Specify a date/time range and select a filter then click either the Encrypt Scree" + - "nshots or Decrypt Screenshots button."; + this.labelScreenshotsHelp.Text = "Select a filter (optional) and specify a date/time range to load screenshots then" + + " click either the Encrypt Screenshots or Decrypt Screenshots button"; // // buttonDecryptScreenshots // @@ -225,7 +227,7 @@ private void InitializeComponent() // // dateTimePickerScreenshotsEndDateRange // - this.dateTimePickerScreenshotsEndDateRange.Location = new System.Drawing.Point(333, 43); + this.dateTimePickerScreenshotsEndDateRange.Location = new System.Drawing.Point(539, 43); this.dateTimePickerScreenshotsEndDateRange.Name = "dateTimePickerScreenshotsEndDateRange"; this.dateTimePickerScreenshotsEndDateRange.Size = new System.Drawing.Size(200, 20); this.dateTimePickerScreenshotsEndDateRange.TabIndex = 3; @@ -234,7 +236,7 @@ private void InitializeComponent() // labelScreenshotsEndDateTimeRange // this.labelScreenshotsEndDateTimeRange.AutoSize = true; - this.labelScreenshotsEndDateTimeRange.Location = new System.Drawing.Point(330, 27); + this.labelScreenshotsEndDateTimeRange.Location = new System.Drawing.Point(536, 27); this.labelScreenshotsEndDateTimeRange.Name = "labelScreenshotsEndDateTimeRange"; this.labelScreenshotsEndDateTimeRange.Size = new System.Drawing.Size(118, 13); this.labelScreenshotsEndDateTimeRange.TabIndex = 2; @@ -243,7 +245,7 @@ private void InitializeComponent() // labelScreenshotsStartDateTimeRange // this.labelScreenshotsStartDateTimeRange.AutoSize = true; - this.labelScreenshotsStartDateTimeRange.Location = new System.Drawing.Point(8, 27); + this.labelScreenshotsStartDateTimeRange.Location = new System.Drawing.Point(232, 27); this.labelScreenshotsStartDateTimeRange.Name = "labelScreenshotsStartDateTimeRange"; this.labelScreenshotsStartDateTimeRange.Size = new System.Drawing.Size(121, 13); this.labelScreenshotsStartDateTimeRange.TabIndex = 1; @@ -251,7 +253,7 @@ private void InitializeComponent() // // dateTimePickerScreenshotsStartDateRange // - this.dateTimePickerScreenshotsStartDateRange.Location = new System.Drawing.Point(11, 43); + this.dateTimePickerScreenshotsStartDateRange.Location = new System.Drawing.Point(235, 43); this.dateTimePickerScreenshotsStartDateRange.Name = "dateTimePickerScreenshotsStartDateRange"; this.dateTimePickerScreenshotsStartDateRange.Size = new System.Drawing.Size(200, 20); this.dateTimePickerScreenshotsStartDateRange.TabIndex = 0; @@ -259,6 +261,8 @@ private void InitializeComponent() // // tabPageFile // + this.tabPageFile.Controls.Add(this.labelHistory); + this.tabPageFile.Controls.Add(this.listBoxHistory); this.tabPageFile.Controls.Add(this.buttonDecryptFile); this.tabPageFile.Controls.Add(this.buttonEncryptFile); this.tabPageFile.Controls.Add(this.textBoxFileKey); @@ -347,8 +351,9 @@ private void InitializeComponent() this.labelFileHelp.Name = "labelFileHelp"; this.labelFileHelp.Size = new System.Drawing.Size(833, 17); this.labelFileHelp.TabIndex = 35; - this.labelFileHelp.Text = "Specify a date/time range and select a filter then click either the Encrypt Scree" + - "nshots or Decrypt Screenshots button."; + this.labelFileHelp.Text = "Give the filepath to a file then click Encrypt File. A key will be generated (and" + + " will not be saved so please remember it). Use the same key for decrypting the f" + + "ile"; // // tabPageText // @@ -443,8 +448,8 @@ private void InitializeComponent() this.labelTextHelp.Name = "labelTextHelp"; this.labelTextHelp.Size = new System.Drawing.Size(833, 17); this.labelTextHelp.TabIndex = 35; - this.labelTextHelp.Text = "Specify a date/time range and select a filter then click either the Encrypt Scree" + - "nshots or Decrypt Screenshots button."; + this.labelTextHelp.Text = "Type some text in the Key field to use for your \"key\". Type some text in the Text" + + " field and click Encrypt Text. Use the same key to decrypt encrypted text"; // // statusStrip // @@ -464,6 +469,29 @@ private void InitializeComponent() this.toolStripStatusLabel.Name = "toolStripStatusLabel"; this.toolStripStatusLabel.Size = new System.Drawing.Size(0, 17); // + // listBoxHistory + // + this.listBoxHistory.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listBoxHistory.FormattingEnabled = true; + this.listBoxHistory.HorizontalScrollbar = true; + this.listBoxHistory.Location = new System.Drawing.Point(6, 115); + this.listBoxHistory.Name = "listBoxHistory"; + this.listBoxHistory.ScrollAlwaysVisible = true; + this.listBoxHistory.Size = new System.Drawing.Size(831, 277); + this.listBoxHistory.TabIndex = 42; + this.listBoxHistory.TabStop = false; + // + // labelHistory + // + this.labelHistory.AutoSize = true; + this.labelHistory.Location = new System.Drawing.Point(6, 99); + this.labelHistory.Name = "labelHistory"; + this.labelHistory.Size = new System.Drawing.Size(42, 13); + this.labelHistory.TabIndex = 43; + this.labelHistory.Text = "History:"; + // // FormEncryptorDecryptor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -527,5 +555,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label1; private System.Windows.Forms.Label labelText; private System.Windows.Forms.TextBox textBoxText; + private System.Windows.Forms.Label labelHistory; + private System.Windows.Forms.ListBox listBoxHistory; } } \ No newline at end of file diff --git a/interface/tools/FormEncryptorDecryptor.cs b/interface/tools/FormEncryptorDecryptor.cs index a50ce3dc..c9200948 100644 --- a/interface/tools/FormEncryptorDecryptor.cs +++ b/interface/tools/FormEncryptorDecryptor.cs @@ -475,7 +475,7 @@ protected void OnScreenshotLoadCompleted(object sender, EventArgs e) { dataGridViewScreenshots.DataSource = null; - toolStripStatusLabel.Text = "Total number of screenshots to be loaded exceeded configured maximum number allowed in load. Please reduce date range or filter appropriately"; + toolStripStatusLabel.Text = "Total number of screenshots to be loaded exceeds configured maximum number allowed in load. Please filter appropriately or reduce date range"; } else { @@ -542,25 +542,70 @@ private void comboBoxFilterType_SelectedIndexChanged(object sender, EventArgs e) private void buttonEncryptFile_Click(object sender, EventArgs e) { + if (string.IsNullOrEmpty(textBoxFilepath.Text)) + { + MessageBox.Show("No filepath provided. Please provide the filepath to a file in the Filepath field.", "Empty Filepath", MessageBoxButtons.OK, MessageBoxIcon.Warning); + + return; + } + if (_fileSystem.FileExists(textBoxFilepath.Text)) { textBoxFileKey.Text = _security.EncryptFile(textBoxFilepath.Text, textBoxFilepath.Text + "-encrypted"); - toolStripStatusLabel.Text = "File encrypted"; + if (_fileSystem.FileExists(textBoxFilepath.Text)) + { + if (_fileSystem.DeleteFile(textBoxFilepath.Text)) + { + _fileSystem.MoveFile(textBoxFilepath.Text + "-encrypted", textBoxFilepath.Text); + + listBoxHistory.Items.Add("[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] File \"" + textBoxFilepath.Text + "\" encrypted using key \"" + textBoxFileKey.Text + "\""); + + listBoxHistory.SelectedIndex = (listBoxHistory.Items.Count - 1); + + toolStripStatusLabel.Text = "File encrypted"; + } + } } } private void buttonDecryptFile_Click(object sender, EventArgs e) { + if (string.IsNullOrEmpty(textBoxFilepath.Text)) + { + MessageBox.Show("No filepath provided. Please provide the filepath to a file in the Filepath field.", "Empty Filepath", MessageBoxButtons.OK, MessageBoxIcon.Warning); + + return; + } + + if (string.IsNullOrEmpty(textBoxFileKey.Text)) + { + MessageBox.Show("No key has been provided to decrypt the file. Please provide the key that was used to encrypt the file in the Key field to ensure that the file can be decrypted.", "Key Not Found", MessageBoxButtons.OK, MessageBoxIcon.Warning); + + return; + } + if (_fileSystem.FileExists(textBoxFilepath.Text)) { try { _security.DecryptFile(textBoxFilepath.Text, textBoxFilepath.Text + "-decrypted", textBoxFileKey.Text); - textBoxFileKey.Text = string.Empty; + if (_fileSystem.FileExists(textBoxFilepath.Text)) + { + if (_fileSystem.DeleteFile(textBoxFilepath.Text)) + { + _fileSystem.MoveFile(textBoxFilepath.Text + "-decrypted", textBoxFilepath.Text); + + listBoxHistory.Items.Add("[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] File \"" + textBoxFilepath.Text + "\" decrypted using key \"" + textBoxFileKey.Text + "\""); - toolStripStatusLabel.Text = "File decrypted"; + listBoxHistory.SelectedIndex = (listBoxHistory.Items.Count - 1); + + textBoxFileKey.Text = string.Empty; + + toolStripStatusLabel.Text = "File decrypted"; + } + } } catch { @@ -571,6 +616,20 @@ private void buttonDecryptFile_Click(object sender, EventArgs e) private void buttonEncryptText_Click(object sender, EventArgs e) { + if (string.IsNullOrEmpty(textBoxText.Text)) + { + MessageBox.Show("No text provided. Please provide text to encrypt.", "No Text", MessageBoxButtons.OK, MessageBoxIcon.Warning); + + return; + } + + if (string.IsNullOrEmpty(textBoxTextKey.Text)) + { + MessageBox.Show("No key provided. Please provide a key to use for encrypting the text.", "Key Not Found", MessageBoxButtons.OK, MessageBoxIcon.Warning); + + return; + } + textBoxText.Text = _security.EncryptText(textBoxText.Text, textBoxTextKey.Text); toolStripStatusLabel.Text = "Text encrypted"; @@ -580,6 +639,20 @@ private void buttonDecryptText_Click(object sender, EventArgs e) { try { + if (string.IsNullOrEmpty(textBoxText.Text)) + { + MessageBox.Show("No text provided. Please provide encrypted text to decrypt.", "No Text", MessageBoxButtons.OK, MessageBoxIcon.Warning); + + return; + } + + if (string.IsNullOrEmpty(textBoxTextKey.Text)) + { + MessageBox.Show("No key provided. Please provide the key that was used to encrypt the text for decrypting the encrypted text.", "Key Not Found", MessageBoxButtons.OK, MessageBoxIcon.Warning); + + return; + } + textBoxText.Text = _security.DecryptText(textBoxText.Text, textBoxTextKey.Text); toolStripStatusLabel.Text = "Text decrypted";