Question
c) Write a Python code to allow user to enter 8 letters and convert them into bits. The format should be LSB to MSB. For
c) Write a Python code to allow user to enter 8 letters and convert them into bits. The format should be LSB to MSB. For example, letter A its binary representation is 01000001, you will list it as 01000010. Thus letters AB will be listed as 1000001001000010.
Comment: it needs to be converted from LSB to MSB for a 8 letter and convert them into bits. then do bitwise shifting LSB to MSB
d) Write a Python code to encrypt the binary from task c with the permutation table from task a and list the encrypted binary on screen.
Comment: I have shared the table a. Here we have to do encryption by taking all the integers in array of a and output of c.
e) Once again, write a Python code to decrypt the encrypted binary from task d with the inverse permutation table from task b and list them on screen.
I am sharing inverse table below for encryption and decryption code by creating an array of output of task b.
"Please answer all step by step previously someone answered partially which is of no use and understanding."
Permutation table is:
57 | 49 | 41 | 33 | 25 | 17 | 9 | 1 |
59 | 51 | 43 | 35 | 27 | 19 | 11 | 3 |
61 | 53 | 45 | 37 | 29 | 21 | 13 | 5 |
63 | 55 | 47 | 39 | 31 | 23 | 15 | 7 |
58 | 50 | 42 | 34 | 26 | 18 | 10 | 2 |
60 | 52 | 44 | 36 | 28 | 20 | 12 | 4 |
62 | 54 | 46 | 38 | 30 | 22 | 14 | 6 |
64 | 56 | 48 | 40 | 32 | 24 | 16 | 8 |
Inverse table:
1 | 9 | 17 | 25 | 33 | 41 | 49 | 57 |
3 | 11 | 19 | 27 | 35 | 43 | 51 | 59 |
5 | 13 | 21 | 29 | 37 | 45 | 53 | 61 |
7 | 15 | 23 | 31 | 39 | 47 | 55 | 63 |
2 | 10 | 18 | 26 | 34 | 42 | 50 | 58 |
4 | 12 | 20 | 28 | 36 | 44 | 52 | 60 |
6 | 14 | 22 | 30 | 38 | 46 | 54 | 62 |
8 | 16 | 24 | 32 | 40 | 48 | 56 | 64 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started