Question: Write a program in C that implements a bit stream cipher decoder. An elementary level bitstream cipher is an encryption algorithm that encrypts 1 byte

Write a program in C that implements a bit stream cipher decoder. An elementary level bitstream
cipher is an encryption algorithm that encrypts 1 byte of plain text at a time. This cipher uses a
given 4-bit bit pattern as the key. The size of the encrypted message that we want to be able to
send has a maximum length of 200 characters. The 4-bit pattern must be duplicated to an 8-bit
value for this to work. (e.g., if we have the 4-bit pattern 0110, then the 8-bit key would be 0110
Here is an example of encryption:
If we have the ASCII value for the letter 't', then that equates to the hex value 074, which
represents the binary value 01110100. If we bitwise XOR the value with a key, say 01010101,
then the resulting encrypted value becomes 0x21(00100001).
Here is an example of decryption:
If we XOR the encrypted value with the key, we get our ASCII back. 00100001 XOR 01010101
becomes 01110100, or 't'.
The bit stream encryption cipher that your program must decode does a little more than this.
After encrypting the value, the program adds an alternating bit rotation twist to the algorithm.
The alternating bit rotation algorithm is such that once you have the encrypted value, it must be
rotated one bit to the left (for example, Ob 00100001 would become 0b 01000010 or 042).
The encrypted value for the 2nd character of the message would be rotated one bit to the right,
3rd character rotated left, 4th rotated right, and so on. As a further example, if 't' is rotated to
the right one position, that would mean 0b 00100001 would become 0b 10010000 or 0x90.
 Write a program in C that implements a bit stream cipher

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!