10.4 Assignment

Overview

10.4 Assignment

Cryptography

Work through the stories in order. Use the acceptance criteria to check each feature, and complete the nested tasks using the specified names, values, and scenarios.

Prepare the WPF cryptography application
Acceptance Criteria
Acceptance criteria
  • The application is WPF rather than Windows Forms.
  • Encrypt, Decrypt, and Source folders exist and the corresponding folder fields point to them.
  • Status text uses label1.Content.
Instructions
1.Follow the Microsoft tutorial about making a cryptographic application.

Walkthrough: Creating a Cryptographic Application

Walkthrough: Creating a Cryptographic Application

Create a .NET Core WPF application instead of a Windows Form Application.

A Follow the Microsoft tutorial about making a cryptographic application.
2.Declaring Global Objects
A For the Declaring Global Objects step, put the provided code at the top of the MainWindow class.
B Create three folders in your solution folder: Encrypt, Decrypt, and Source. Change the values for EncrFolder, DecrFolder,…

Create three folders in your solution folder: Encrypt, Decrypt, and Source. Change the values for EncrFolder, DecrFolder, and SrcFolder to point to the new Encrypt, Decrypt, and Source folders.

Manage asymmetric keys
Acceptance Criteria
Acceptance criteria
  • Key creation follows the walkthrough and reports its result through the WPF status label.
  • The public-key import and private-key retrieval actions are implemented.
  • All references to the Windows Forms label property are adapted to Content.
Instructions
3.Creating an Asymmetric Key
A Change the references from label1.Text to label1.Content.
4.Importing a Public Key
A Change the references from label1.Text to label1.Content.
5.Getting a Private Key
A Change the references from label1.Text to label1.Content.
Encrypt and decrypt selected files
Acceptance Criteria
Acceptance criteria
  • Microsoft.Win32.OpenFileDialog is used and selection proceeds only when ShowDialog returns true.
  • The specified symmetric algorithm uses KeySize 128 and BlockSize 128 for this exercise.
  • Two text files from Source are encrypted and then decrypted successfully.
  • Generated test output is cleaned up as directed, and the finished code is StyleCop compliant.
Instructions
6.Encrypting a File
A Define and instantiate an OpenFileDialog variable (located in Microsoft.Win32 namespace). Reference that variable instead of…

Define and instantiate an OpenFileDialog variable (located in Microsoft.Win32 namespace). Reference that variable instead of openFileDialog1.

B In the if statement checking ShowDialog, check if it is equal to true instead of DialogResult.OK
C Change the rjndl.KeySize and rjndl.BlockSize to 128.
7.Decrypting A File
A Define and instantiate an OpenFileDialog variable (located in Microsoft.Win32 namespace). Reference that variable instead of…

Define and instantiate an OpenFileDialog variable (located in Microsoft.Win32 namespace). Reference that variable instead of openFileDialog2.

B In the if statement checking ShowDialog, check if it is equal to true instead of DialogResult.OK
C Change the rjndl.KeySize and rjndl.BlockSize to 128.
8.Testing
A Create two text files in your Source folder to use for testing.
B Before submitting, delete the files in the encrypt and decrypt folders.
9.Ensure your code is StyleCop compliant.
A Ensure your code is StyleCop compliant.
Completion review
10.Review the feature acceptance criteria
A Confirm the required results

Return to each story and verify its acceptance criteria. Preserve the submission format and destination stated in the activity; a reading, setup guide, lab, video demonstration, and oral final may require different evidence.

Prepare the WPF cryptography application Manage asymmetric keys Encrypt and decrypt selected files