Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Assignment 2 Problems – String conversion: Implement a function which converts an input string to a set of blocks for cryptographic computation

Assignment 2 Problems – String conversion: Implement a function which converts an input string to a set of blocks for cryptographic computation

Computer Science

Assignment 2

Problems – String conversion:

Implement a function which converts an input string to a set of blocks for cryptographic computation. Specifically, the function should take an input a string and a block size and output a list (or an array) of converted string.

Pre/post conditions for the function is as follows:

• encode (P, N) - Pre-condition: The function takes a string ??, e.g., P=`hello world` and a block size N, e.g., N=8 (8 bit).

 - Intermediate process: It first convert the string into ASCII codes, e.g., P=104 101 108 108 111 32 119 111 114 108 100, then split it by the other input N –

Post-condition: It outputs a list of number blocks, e.g., PL=[104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100].

• decode (PL, N) - It recovers the original string Since 8-bit can express 0-255, the function does not need to split the values.

It just converts each character and puts into a list. However, if N is greater than 8, you should find a rule to avoid information lost.

The implementation must include Good test codes to demonstrate the correctness of your program.

 

 

 

 

 

 

 

 

 

 

 

 

Give some DETAIL on the algorithms and code that you are implementing. 

Include the OUTPUT or list the name of the output file you are submitting.

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions