Dec 03, 2024 | 218 words | 2 min read
9.2.3. Task 3#
Learning Objectives#
Convert a binary message into readable text.
Task Instructions#
Save the flowcharts for each of your tasks in tp1_team_teamnumber.pdf You will also need to include these flowcharts in your final report.
Write Python code that converts a binary string into ASCII text. Each character in the message is represented by 8 bits (1 byte). Convert each byte into its corresponding ASCII character and append it to a final message string. Name this program tp1_team_3_partial_teamnumber.py.
Sample Output
Use the values in Table 9.18 below to test your program.
# Case
binary text
1
0100100001100101011011000110110001101111
2
0111011101101111011100100110110001100100
Ensure your program’s output matches the provided samples exactly. This includes all characters, white space, and punctuation. In the samples, user input is highlighted like this for clarity, but your program should not highlight user input in this way.
Case 1 Sample Output
$ python3 tp1_team_3_teamnumber.py Enter the binary message: 0100100001100101011011000110110001101111 Converted Text: Hello
Case 2 Sample Output
$ python3 tp1_team_3_teamnumber.py Enter the binary message: 0111011101101111011100100110110001100100 Converted Text: world
Integrate this code into the LSB extraction code from Task 2 to extract and display the hidden message in a human-readable format. Name this program tp1_team_3_teamnumber.py.
Sample Output
Use the values in Table 9.19 below to test your program.
# Case
image_path
start_seq
end_seq
1
ref_col_p.png
007
700
2
ref_gry_p.png
007
700
3
ref_gry_p.png
222
333
Ensure your program’s output matches the provided samples exactly. This includes all characters, white space, and punctuation. In the samples, user input is highlighted like this for clarity, but your program should not highlight user input in this way.
Case 1 Sample Output
$ python3 tp1_team_teamnumber.py Enter the path of the image you want to load: ref_col_p.png Enter the start sequence: 007 Enter the end sequence: 700 Below is the img_array output of ref_col_p.png: Extracted Message: 0100110001010101010000110100101101011001 Converted Text: LUCKY
Case 2 Sample Output
$ python3 tp1_team_teamnumber.py Enter the path of the image you want to load: ref_gry_p.png Enter the start sequence: 007 Enter the end sequence: 700 Below is the img_array output of ref_gry_p.png: Extracted Message: 0100100001000101010011000100110001001111 Converted Text: HELLO
Case 3 Sample Output
$ python3 tp1_team_teamnumber.py Enter the path of the image you want to load: ref_gry_p.png Enter the start sequence: 222 Enter the end sequence: 333 Below is the img_array output of ref_gry_p.png: Start or end sequence not found in the image.