1 Description The project will be implemented as three separate programs. There will be a logger...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1 Description The project will be implemented as three separate programs. There will be a logger - responsible for logging all activity. There will be an encryption program - responsible for encrypting and decrypting strings. There will be a driver program that will interact with the user to use the encryption program. The entire system will be ran by running the driver program, which will launch the other programs and communicate with them through pipes. If you use C/C++ to code your project you must use the linux system calls fork,pipe, and dup2. If use Java to code your project you must use the Process class. If you use Python use the Subprocess module. Examples for all these approaches will be provided in class. Details of each of the programs are below. 2 Details 2.1 Logger The logger will write log messages to a log file. The log messages are lines of text where the first sequence of non-whitespace characters is considered the action, and the rest of the line is considered the message. The log message will be recorded, with a time stamp in 24 hour notation, in the log file as a single line using the following format: YYYY-MM-DD HH:MM [ACTION] MESSAGE So, the log message "START Logging Started." logged March 2nd, 2022 at 11:32 am would be recorded as: 2022-03-02 11:32 [START] Logging Started. The logger program should accept a single commandline argument - the name of the log file. The logger program will then accept log messages via standard input until it receives "QUIT". 2.2 Encryption Program The encryption program should accept commands given as lines via standard input. The first word (sequence of non-whitespace characters) should be treated as a command, and the rest of the line(after the first space) as the argument for that command. Output is printed to standard out as a line of text where the first word is a response type. The currently set key is remembered by the encryption program. The encryption program should handle the following commands: PASSKEY - Sets the current passkey to use when encrypting or decrypting. ENCRYPT - Using a Vigenère cypher with the current passkey, encrypt the argument and output the result. If no passkey is set output an error. DECRYPT - Using a Vigenère cypher with the current passkey, decrypt the argument and output the result. If no passkey is set output an error. QUIT - Exit the program. The encryption program has the following response types: RESULT - The preceding command succeeded. The rest of the line (after a space) is the result of the executed command. ERROR - The preceding command failed. The rest of the line (after a space) is the error message. More information on the Vigenère cypher can be found at https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher 2.2.1 Example Interaction Below is a single run of the encryption program. • Input: ENCRYPT HELLO Output: ERROR Password not set • Input: PASSKEY HELLO Output: RESULT Input: ENCRYPT HELLO Output: RESULT OIWWC 2.3 Driver Program The driver program should accept a single commandline argument the name of the log file. Upon start, the driver program will create two new processes, executing the logger (giving the log file name as a commandline argument) and the encryption program. Pipes should be used to connect to their standard input and standard output. Python and Java provide streams to communicate over these pipes. C/C++ will need to use the read and write system calls to communicate. Once set up, the driver program should print a menu of commands and prompt the user for commands, looping until the quit command is received. Each command should be logged, and the result of each command should also be logged. The start and exit of the driver program should be logged. All strings entered to be encrypted or decrypted should be saved in a history that lasts only for this run. The driver program should accept the following commands. password - Provide the user with the option of using a string in the history or entering a new string. If a new string will be used, prompt the user for a password, and then set it as the current password in the encryption program. If the history will be used, provide the user with a menu where a number can be used to select a string stored in the history. The entered password is not stored in the history. Notice that password is used by the driver and passkey is used by the encryption program. encrypt - Provide the user with the option of using a string in the history or entering a new string. If a new string will be used, prompt the user for a string, record it in the history, and send an encrypt command to the encryption program. If the history will be used, provide the user with a menu where a number can be used to select a string stored in the history. The results should be printed to standard output and saved in the history. decrypt - Provide the user with the option of using a string in the history or entering a new string. If a new string will be used, prompt the user for a string, record it in the history, and send an decrypt command to the encryption program. If the history will be used, provide the user with a menu where a number can be used to select a string stored in the history. The results should be printed to standard output and saved in the history. history - Show the history. quit - Send QUIT to the encryption program and logger, and then exit the program. In the above commands whenever the history is used, provide the user with a means to exit the history and enter a new string. Passwords are never directly logged. Notice that commands to the encryption program are all on one line, but the driver program is more interactive. The command is expected to be inputted separately, and a separate prompt will ask for more information, such as the string to encrypt. 1 Description The project will be implemented as three separate programs. There will be a logger - responsible for logging all activity. There will be an encryption program - responsible for encrypting and decrypting strings. There will be a driver program that will interact with the user to use the encryption program. The entire system will be ran by running the driver program, which will launch the other programs and communicate with them through pipes. If you use C/C++ to code your project you must use the linux system calls fork,pipe, and dup2. If use Java to code your project you must use the Process class. If you use Python use the Subprocess module. Examples for all these approaches will be provided in class. Details of each of the programs are below. 2 Details 2.1 Logger The logger will write log messages to a log file. The log messages are lines of text where the first sequence of non-whitespace characters is considered the action, and the rest of the line is considered the message. The log message will be recorded, with a time stamp in 24 hour notation, in the log file as a single line using the following format: YYYY-MM-DD HH:MM [ACTION] MESSAGE So, the log message "START Logging Started." logged March 2nd, 2022 at 11:32 am would be recorded as: 2022-03-02 11:32 [START] Logging Started. The logger program should accept a single commandline argument - the name of the log file. The logger program will then accept log messages via standard input until it receives "QUIT". 2.2 Encryption Program The encryption program should accept commands given as lines via standard input. The first word (sequence of non-whitespace characters) should be treated as a command, and the rest of the line(after the first space) as the argument for that command. Output is printed to standard out as a line of text where the first word is a response type. The currently set key is remembered by the encryption program. The encryption program should handle the following commands: PASSKEY - Sets the current passkey to use when encrypting or decrypting. ENCRYPT - Using a Vigenère cypher with the current passkey, encrypt the argument and output the result. If no passkey is set output an error. DECRYPT - Using a Vigenère cypher with the current passkey, decrypt the argument and output the result. If no passkey is set output an error. QUIT - Exit the program. The encryption program has the following response types: RESULT - The preceding command succeeded. The rest of the line (after a space) is the result of the executed command. ERROR - The preceding command failed. The rest of the line (after a space) is the error message. More information on the Vigenère cypher can be found at https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher 2.2.1 Example Interaction Below is a single run of the encryption program. • Input: ENCRYPT HELLO Output: ERROR Password not set • Input: PASSKEY HELLO Output: RESULT Input: ENCRYPT HELLO Output: RESULT OIWWC 2.3 Driver Program The driver program should accept a single commandline argument the name of the log file. Upon start, the driver program will create two new processes, executing the logger (giving the log file name as a commandline argument) and the encryption program. Pipes should be used to connect to their standard input and standard output. Python and Java provide streams to communicate over these pipes. C/C++ will need to use the read and write system calls to communicate. Once set up, the driver program should print a menu of commands and prompt the user for commands, looping until the quit command is received. Each command should be logged, and the result of each command should also be logged. The start and exit of the driver program should be logged. All strings entered to be encrypted or decrypted should be saved in a history that lasts only for this run. The driver program should accept the following commands. password - Provide the user with the option of using a string in the history or entering a new string. If a new string will be used, prompt the user for a password, and then set it as the current password in the encryption program. If the history will be used, provide the user with a menu where a number can be used to select a string stored in the history. The entered password is not stored in the history. Notice that password is used by the driver and passkey is used by the encryption program. encrypt - Provide the user with the option of using a string in the history or entering a new string. If a new string will be used, prompt the user for a string, record it in the history, and send an encrypt command to the encryption program. If the history will be used, provide the user with a menu where a number can be used to select a string stored in the history. The results should be printed to standard output and saved in the history. decrypt - Provide the user with the option of using a string in the history or entering a new string. If a new string will be used, prompt the user for a string, record it in the history, and send an decrypt command to the encryption program. If the history will be used, provide the user with a menu where a number can be used to select a string stored in the history. The results should be printed to standard output and saved in the history. history - Show the history. quit - Send QUIT to the encryption program and logger, and then exit the program. In the above commands whenever the history is used, provide the user with a means to exit the history and enter a new string. Passwords are never directly logged. Notice that commands to the encryption program are all on one line, but the driver program is more interactive. The command is expected to be inputted separately, and a separate prompt will ask for more information, such as the string to encrypt.
Expert Answer:
Answer rating: 100% (QA)
Heres a theoretical breakdown of the described system Logger Program Responsibility Responsible for logging activity messages to a specified log file Log Message Format Log messages are written with a ... View the full answer
Related Book For
Operations Management Creating Value Along the Supply Chain
ISBN: 978-1118301173
1st Canadian Edition
Authors: Roberta S. Russell, Bernard W. Taylor, Ignacio Castillo, Navneet Vidyarthi
Posted Date:
Students also viewed these programming questions
-
Chromalox Instruments and Controls, located in LaVergne, Tennessee, is a manufacturer of industrial process controllers, monitors, and industrial and military control panels. Chromalox products are...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
1. Can you explain why business majors apparently study less, on average, than students in other majors? 2. Can you explain why business students writing and reasoning skills apparently increase less...
-
Windmill Corporation manufactures products in its plants in Iowa, Canada, Ireland, and Australia. Windmill conducts its operations in Canada through a 50 percent owned joint venture, CanCo. CanCo is...
-
You choose 6 adults at random. What is the probability that none of the six say some of their closest family and friends have food allergies or intolerances? Use the pie chart, which shows the...
-
Refer to the information in Exercise 16-6. Assume that Fields uses the FIFO method of process costing. 1. Calculate the equivalent units of production for the forming department. 2. Calculate the...
-
Cortez Company sells chairs that are used at computer stations. Its beginning inventory of chairs was 100 units at $60 per unit. During the year, Cortez made two batch purchases of this chair. The...
-
Make relational model from this ER diagram 2. Convert the following ER diagram into relations/tables: row seat toCust SSNo Bookings Customers phone name Flights to Flt addr number aircraft day
-
Figure 9-26 illustrates a partial class diagram for a property management company. Using the data in the class diagram, create a database schema.
-
Bank reconciliation on May 2, 2014 a client called you frantically because he just got a call from the bank manager stating the company bounced numerous checks. The client suspects that the new...
-
What challenges, advantages, and disadvantages do teams in multiple countries and geographies face during a company's product development project phase? Are virtual teams versus co-located teams...
-
A 302-km-long high-voltage transmission line 5.00 cm in diameter carries a steady current of 1,400 A. If the conductor is copper with a free charge density of 8.50 1028 electrons per cubic meter,...
-
You need $4,500 in two years to take some courses only offered in the summer. You can earn a 4% interest rate on your investment compounded quarterly. How much should you invest today in a lump sum...
-
Mutual Bank issues a $23 million collateralized mortgage obligation (CMO). There are 4 tranches in the CMO as follows. Tranche Total bond value Interest rate A $5 million 2.5% B $5 million 3.5% C $6...
-
What are the organizational challenges associated with the flexible development (overdesign and parallel path) approaches?
-
Cost of goods sold is given by: Beginning inventory + accounts payable - net purchases. Beginning inventory - net purchases + ending inventory. Net Purchases + beginning inventory - ending inventory....
-
Time Travel Publishing was recently organized. The company issued common stock to an attorney who provided legal services worth $25,000 to help organize the corporation. Time Travel also issued...
-
The manager of Sarahs Ice Cream store needs an accurate forecast of the demand for ice cream. The store orders ice cream from a distributor a week ahead, and if too little is ordered the store loses...
-
Under what conditions will the single-channel, single-phase queuing model with Poisson arrivals and undefined service times provide the same operating characteristics as the basic model with...
-
The Canucks major league baseball team is going to enter the free agent market over the winter to sign a new starting pitcher. They are considering five prospects who will enter the free agent...
-
Please reflect on and explain the role and usefulness of the concept of SD in relation to the protection of the environment.
-
Has the concept of SD achieved the balance between all three pillars: environmental protection; economic development; and social issues?
-
What, if any, is the normative content of the concept of SD?
Study smarter with the SolutionInn App