72.1k views
2 votes
Write a program that encrypts the alphabetic letters in a file using the Hill cipher where the Hill matrix can be any size from 2x 2 up to 9x 9. Your program will taketwo command line parameters containing the names of the file storing the encryption key and the file to be encrypted. The program must generate output to the console (terminal) screen as specified below.

A)Command line parameters - Your program must compile and run from the terminal command line.

User Joshcomley
by
8.0k points

1 Answer

6 votes

Final answer:

The question is asking for a program that implements the Hill cipher to encrypt alphabetic letters in a file. The program must handle encryption key sizes from 2x2 up to 9x9 and output the encrypted text to the console, taking two command line parameters for key and text files.

Step-by-step explanation:

The Hill cipher is a cryptography algorithm that encrypts alphabetic letters using linear algebra. A Hill cipher encryption program is a computational application designed to encrypt the contents of a file using a specified Hill cipher key matrix. The process involves transforming the plaintext into numerical vectors based on the alphabetical index and then multiplying these vectors by an invertible key matrix (whose size can vary from 2x2 up to 9x9).

The program proposed in the question should be capable of taking two command line parameters: one for the file containing the encryption key and the other for the file to be encrypted. This type of program typically involves reading the input files, generating a key matrix from the key file, splitting the text into blocks corresponding to the size of the matrix, applying matrix multiplication modulo the alphabet size, and finally converting the numeric vectors back to letter characters to form the ciphertext output to the console.

User Ananke
by
7.4k points