Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1 Please write a function/method to implement a stream cipher algorithm which takes three inputs 1- The message to encrypt (A string) 2- The

Part 1

Please write a function/method to implement a stream cipher algorithm which takes three inputs

1- The message to encrypt (A string)

2- The key (A string)

3- The algorithm (A string that is one of these: OR, AND, XOR)

Constraints

1- The key can not be bigger than the message string.

2- If the key is smaller than the message, the key should be repeated to match the size of message.

Example:

Message = 10101010011110010 Key = 1100

10101010011110010 - Message

11001100110011001 - Key with the size adjusted to the message.

3 - The function should not accept an algorithm other than OR, AND, XOR. If tried, it should give the message "Unknown algorithm"

Function

1 - Convert message and the key into binary form.

2 - Apply the given operation on the input and the key.

3 - Convert the resulted output into String

Part 2

1 - Explain the advantages and disadvantages of block and stream ciphers in a paragraph

2 - Explain the advantages and disadvantages of synchronous and asynchronous ciphers in a paragraph

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

Which were the causes of high employee turnover at Fomco Group?

Answered: 1 week ago

Question

KEY QUESTION Refer to Figure 3.6, page

Answered: 1 week ago