Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please program in C++ Thank you. The plain text and key are in seperate .txt files already on computer. The key is in binary. needed

image text in transcribed
image text in transcribed
Please program in C++ Thank you. The plain text and key are in seperate .txt files already on computer. The key is in binary. needed for program: Encryption: encrypt a plain text file by XORing it with the key file - create an array for the ASCII characters that can be printed for the plain text file and the key file - read the plain text file and the key file write to the ciphertext file in binary Decryption: (assume key and key length are unknown) - find length of the key. you can guess on how long you think it is. ex. maxlength = 10 - try every key length up until the max. (every key length has one summation of Pi squared) - create a function to calculate Pi squared ex. int A[128]; (L = key length) Pi square (A[ ], L, "filename) create a function to calculate the distribution ex. double dist (maxlength]; void calc distribution (dist [], A[], L, filename) - read the ciphertext and sample L - find the max distribution (that is the key) can then use xor to get plaintext by XORing ciphertext and key. ex. p = c^k Vigenre cipher program: I need a C++ program that encrypts plaintext with the key by using XOR. Once the cipher text is created, it needs to be decrypted by first finding the key length and then finding each key character. Then use the key to decrypt the text using XOR. Read key from key.txt (binary) and message from ptext.txt (ASCII) Output cipher text to ctext.txt (binary)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

List the five steps taken in preparing a work sheet.

Answered: 1 week ago