0% found this document useful (0 votes)
14 views5 pages

Create Performance Task-Practice-1

The document outlines a program designed for secure communication through message encryption and decryption using a key list. It describes the program's functionality, user input/output, and the significance of the data stored in the list, which is essential for scrambling and unscrambling messages. Additionally, it details the algorithm's steps, procedure calls, and the conditions being tested during execution.

Uploaded by

Chandler Wang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views5 pages

Create Performance Task-Practice-1

The document outlines a program designed for secure communication through message encryption and decryption using a key list. It describes the program's functionality, user input/output, and the significance of the data stored in the list, which is essential for scrambling and unscrambling messages. Additionally, it details the algorithm's steps, procedure calls, and the conditions being tested during execution.

Uploaded by

Chandler Wang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

CREATE PERFORMANCE TASK-PRACTICE

VIDEO: https://somup.com/cTeebD7Fbh
1. Describe the overall purpose of the program. This program is designed to
allow people to communicate in a secretive manner. This allows users to
exchange information discreetly and protectively. Only someone with access to
the same algorithm and key list can decode the message, making it a simple
yet effective tool for protecting messages and communication.

2. Describe the functionality of the program. This program allows users to


input a message to be encrypted or decrypted based on the users selected.
Upon choosing encryption, the program uses a predefined function to scramble
each character. If the user selects decryption, the program reverses the
process by applying the same sequence to restore the original message. The
program handles user input by prompting desired operation, and outputting
the result, making an efficient tool for basic cryptographic measures.

3. Describe the input and output of the program demonstrated in the video.
The input of this program has two parts: first is the message and second is
whether the user wants it to be encrypted or decrypted by entering either ‘e’
or ‘d’. If the user chooses ‘e’ for encryption, the program outputs a scrambled
version of the original message using the key. If ‘d’ for decryption is inputted,
the program outputs the original message by reversing the process. If the user
inputted an invalid input, then the program outputs the error and prompts
them to enter a valid input ensuring the program runs.

4. Which part of the program code shows how the data has been stored in
the list. Paste Screenshot

5. Place a screenshot of the program code segment that shows the data in
the same list being used, such as creating new data from existing data or
accessing multiple elements in the list, as part of fulfilling the program’s
purpose.

6. Place a screen shot showing a student-developed procedure that:


 Defines the procedure’s name and return type (if necessary)
 Contains and uses one or more parameters that influence the
functionality of the procedure.
 Implements an algorithm that includes sequencing, selection,
and iteration.

7. Identify the name of the list being used.

scramble_message

8. Describe what the data contained in the list represents in your program.

The data in the list represents a sequence of numerical values that are the key
for scrambling and unscrambling the message within the program. Each
number is used to determine how much the corresponding character should be
shifted, repeating them as necessary for longer messages. Even and odd
values are handled differently, adding security to the code. The list acts as a
customizable key for unique patterns of character changes, making it essential
for encryption.

9. Explain how the selected list manages complexity in your program code
by explaining why your program code could not be written, or how it
would be written differently if you did not use the list.

The list manages the ability for the code to scramble the message because it
provides the key to follow when altering the message. It serves as a
reusable and organized collection of values that guides the scrambling
process. If you were to not use the list, it would be very difficult for the
code to fulfill its functionality because there would be no key to follow,
unless if you were to manually specify each character encrypted. This
would make it much longer, harder to read and nearly impossible to scale.

9. Describes in general what the identified procedure does and how it


contributes to the overall functionality of the program.
The identified procedure takes each value in the message and scrambles it
using the key provided in the list which performs a major operation of the
users choice in the program. This procedure is essential because it
defines how the data is scrambled or encrypted, making it one of the sole
features of the program’s purpose. This process is the core functionality
of the program, as it enables the primary feature of converting a
readable message into an encoded form. This procedure is executed to
obscure the message. Without this mechanism, the program would not
fulfill its functionality that the user wants.

10. Describe in detailed steps how the algorithm implemented in the


identified procedure works. Your explanation must be detailed enough for
someone else to recreate it.

1. Create a key list: define a list of integers called keylist. This list contains a
repeating pattern of numbers.

2. Prompt for a message: ask the user to enter the message they want to
encrypt

3. Define a scramble_message function with the parameter message.

4. Create an empty list named scrambled

5. Iterate through the message using a for loop and the keylist to find the
corresponding key using the modulus operation to make sure the keylist
loops if the message is longer than the list.

6. Check if the key is even: convert the character to its Unicode value and add
the key. Use modulo 256 to keep the result within the valid character
range and convert it back to a character.

7. If the key is odd, add the key plus two and repeat the process in step 6.

8. After the loop finishes, return the final scrambled message

11. Describe two calls to the procedure identified in #4 and #5. Each call
must pass a different argument(s) that causes a different segment of
code in the algorithm to execute. (It would help if you ran the code in
codhs)

Test 1: scramble_message(“hello”)
Test 2: scramble_message(“hi”)

Describe what condition(s) is being tested by each call to the procedure.

1st Condition: Tests scenario where index of the character is even.

2nd Condition: Tests scenario where index of the character is odd.

Identify the results of each call.

1st Result: kiqmp

2nd Result: hj

You might also like