Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help with python3 ola for CSCI 1170 Objectives: o To gain experience in functional decomposition o To gain experience designing and implementing functions in Python

Help with python3 ola for CSCI 1170

image text in transcribed

Objectives: o To gain experience in functional decomposition o To gain experience designing and implementing functions in Python 0 To galn experience Integrating functional components Into a larger program Descriptlon: Often times in the development of large, complex software, we ill decompose a problem into many sub-problems where we can easily design functlonality to solve. When we perfom this decomposition, we separate the functionality and test it independently to ensure that it is syntactically and logically correct. After we have verified the correctness of our solution, we will integrate the solution into our program, which is a solution to the overall problem. Recall, that since OLA 102, we have been developing a simple toolkit that can be used to detect rootkits and in OLA 103, we developed the functionality to encrypt messages using the caesar cipher This OLA will incorporate both of the previous OLAs. Requirements: In this OLA, we will practice decomposing the tunctionality we developed in OLA 103 and integrate this functionality into our working toolkits from OLA 102. After accomplishing this integration, we will provide more user interface options to the User as our toolkit's functionality has expanded. To integrate the functionality of OLA 103 into this OLA, we will design a value-returning function. Your function should have the following properties: 1. It should take a string and encrypt it by applying a key to the string. This should be the same as we did it in OLA 103. 2. It should return the encrypted string 3. It should not ask the user to input a string. This is the responsibility of the user interface 4. It should not print the encrypted string. This is the responsibillty of the user interface You may not use global variables to pass data to your new function or out of your function. You must call the function with the proper arguments. Other restrictions 1. You may perform input validation. However, it is not required. 2. You may not use a loop to continually ask the user what to do outside of valldating input. More clearly, if the user properly inputs a choice, your program will call the necessary function to perform the functionality requested and then your program will exit. You will place this newly designed function into a file called cipher.py. Your user interface will need to import cipher as a module to use its functionality An example run of the expected output can be seen below 1143 ranger2s python3 integrity-py What would you like to do? (G)enerate hashes (C)heck the statc of filcs (E)ncrypt a message Choice:G Enter the path: /bin 1144 ranger2s python3 integrity-py What would you like to do? (G)enerate hashes (C)heck the state of files (E)ncrypt a message Choice: C Enter the path: /bin ile /bin/findmnt is OK File hin/cp is CK File /bin/systemd notify is OK File /bin/systemd escape 18 OK File /bin/lessfile is OK 1145 ranger2$ python3 integrity.py at would you likc to do? (G)cnerate hashes (C)eck the state of files (E)ncrypt a message Choice: E Enter a message to encrypt I want to encrypt this mesaage Enter a key 10 cipher: S gkxd dy oxmbizd drsc wocckqo 1146 ranger2S Objectives: o To gain experience in functional decomposition o To gain experience designing and implementing functions in Python 0 To galn experience Integrating functional components Into a larger program Descriptlon: Often times in the development of large, complex software, we ill decompose a problem into many sub-problems where we can easily design functlonality to solve. When we perfom this decomposition, we separate the functionality and test it independently to ensure that it is syntactically and logically correct. After we have verified the correctness of our solution, we will integrate the solution into our program, which is a solution to the overall problem. Recall, that since OLA 102, we have been developing a simple toolkit that can be used to detect rootkits and in OLA 103, we developed the functionality to encrypt messages using the caesar cipher This OLA will incorporate both of the previous OLAs. Requirements: In this OLA, we will practice decomposing the tunctionality we developed in OLA 103 and integrate this functionality into our working toolkits from OLA 102. After accomplishing this integration, we will provide more user interface options to the User as our toolkit's functionality has expanded. To integrate the functionality of OLA 103 into this OLA, we will design a value-returning function. Your function should have the following properties: 1. It should take a string and encrypt it by applying a key to the string. This should be the same as we did it in OLA 103. 2. It should return the encrypted string 3. It should not ask the user to input a string. This is the responsibility of the user interface 4. It should not print the encrypted string. This is the responsibillty of the user interface You may not use global variables to pass data to your new function or out of your function. You must call the function with the proper arguments. Other restrictions 1. You may perform input validation. However, it is not required. 2. You may not use a loop to continually ask the user what to do outside of valldating input. More clearly, if the user properly inputs a choice, your program will call the necessary function to perform the functionality requested and then your program will exit. You will place this newly designed function into a file called cipher.py. Your user interface will need to import cipher as a module to use its functionality An example run of the expected output can be seen below 1143 ranger2s python3 integrity-py What would you like to do? (G)enerate hashes (C)heck the statc of filcs (E)ncrypt a message Choice:G Enter the path: /bin 1144 ranger2s python3 integrity-py What would you like to do? (G)enerate hashes (C)heck the state of files (E)ncrypt a message Choice: C Enter the path: /bin ile /bin/findmnt is OK File hin/cp is CK File /bin/systemd notify is OK File /bin/systemd escape 18 OK File /bin/lessfile is OK 1145 ranger2$ python3 integrity.py at would you likc to do? (G)cnerate hashes (C)eck the state of files (E)ncrypt a message Choice: E Enter a message to encrypt I want to encrypt this mesaage Enter a key 10 cipher: S gkxd dy oxmbizd drsc wocckqo 1146 ranger2S

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions