Write a program to implement the secure unicast protocol

Assignment Help Other Subject
Reference no: EM132349429

Question 1 - An RC4 state is a 256 bytes states with two 8-bit index pointers i and j denoted by (S, i, j). The initial RC4 state is generated by KSA denoted by (S0, i = 0, j = 0).

An important feature of RC4 is that the RC4 state is reversible. That is, if (S*, i*, j*) = PRGAn (S, i, j), it has (S, i, j) = IPRGAn (S*, i*, j*) where PRGAn denotes applying n rounds PRGA (same for IPRGAn) and IPRGA is the reverse algorithm of PRGA. This feature means that any former RC4 state can be recovered from a later RC4 state by applying certain rounds IPRGA. Write code to implement both the PRGA algorithm and the following IPRGA algorithm and design and implement a way to confirm that any RC4 state can go forward by PRGA and backward by IPRGA.

IPRGA(S, i, j)

Generation loop:

S[i] ↔ S[j]

j ← (j - S[i] + 256)mod 256

i ← (i - 1)mod 256

Note: Your related documentation should include introduction to your code, external comments, how to run your code, and all screen shots of running your code, etc. Your source code should include the internal comments.

Question 2 - An RC4 state based secure unicast protocol is described in the following: Suppose A (sender) and B (receiver) posses the same secure key (128 bits) to initialize RC4 state (S, i, j)A for A and (S, i, j)B for B and initially (S, i, j)A = (S, i, j)B = (S, i, j)o. Initially A and B also set their sequence counters to zero. Each data packet has 272 bytes (4 bytes for sequence counter value, 252 bytes for data segment and 16 bytes for hash value):

SC (4 bytes) Data Segment (252 bytes) HV (16 bytes)

For Sender:

1. The sender divides the input plaintext message into contiguous 252-byte data segments and assigns SC to each of them. The sequence counter (SC) value is increased by 1 in increased order (initially SCA = 0). If there are not enough data in the data segment of the last data packet, pad a 1 followed by as many 0 as necessary.

2. The sender calculates the hash value for that data packet by inputting SC and the unencrypted data segment, and then places the 128-bit hash value into the data packet.

3. The sender produces the encrypted data packets by only encrypting data segment and hash value (do not encrypt SC value). The sender updates its SCA and (S, i, j)A after the encryption.

For Receiver:

Initially (S, i, j)B = (S, i, j)0 and SCB = 0. When receiving a new packet, B compares its own SC value (SCB) with the SC value of the packet. If the difference of the SC value of the packet and its own SC value (SCpacket - SCB) is 0, then (S, i, j)B is used as the RC4 state to decrypt the data segment and hash value of that incoming packet and then increase the sequence counter by 1. Otherwise, calculate the right RC4 state from current (S, i, j)B by applying certain rounds of PRGA or IPRGA, and then use the right RC4 state to decrypt the data segment and hash value of that incoming packet and set the sequence counter value of receiver by the SC value of the packet plus 1. B also needs to calculate the hash value according to the decrypted data (SC and data segment) and then compare it with the one directly get from decrypted packet (comparison is required, but assume it always match).

Write a program with two interfaces (one for sender, and the another for receiver) to implement the above secure unicast protocol.

Test your program by a 1000 bytes message (4 packets). Suppose:

Case 1: the sequence of the packets received is 0, 1, 2 and 3

Case 2: the sequence of the packet received is 1, 0, 3 and 2

Case 3: the sequence of the packet received is 3, 2, 1 and 0

Note: Your related documentation should include introduction to your code, external comments, how to run your code, and all screen shots of running your code, etc. Your source code should include the internal comments. The plaintext and 128-bit key are input to your program. You should not hard code them or put them into a file, and they should be inputted through the interfaces. Before run your program, the same key should be inputted through interfaces for both sender and receiver, but plaintext should only be inputted through the interface for the sender.

5. You should use ABCDEF0123456789ABC2018||your ID number (9 hexadecimal digits, || is a connection symbol, not a part of the key) as the secure key. There is no requirement for your 1000-byte input message, but the input message should be readable.

6. You can choose any hash function to calculate the hash value. Please remember the required hash value is 16 bytes so if the hash value generated by the hash function you choose is not 16 bytes, a transformation designed and implemented by you is necessary.

Reference no: EM132349429

Questions Cloud

Discuss the importance of data quality : Discuss the importance of data quality, and give 3 examples of how to ensure quality data. (Examples include no duplication, no missing data, no data errors.
Define the number of characters for each data element : When designing data definitions, you will be assigning meaning to the data elements that are part of the computerized data. If there is no definition.
Overall organization of the paper and presentation : Proper identification of the processes within the researched department. Overall organization of the paper and presentation.
What will need to be done to prepare for ehr implementation : Now that you have identified the data sets, discussed the electronic health record (EHR) and computerized physician order entry (CPOE), and identified patient.
Write a program to implement the secure unicast protocol : Write a program with two interfaces (one for sender, and the another for receiver) to implement the above secure unicast protocol
Is anything still unclear that could be clarified : What were the most compelling topics learned in this course? How did participating in discussions help your understanding of the subject matter?
Relationship between population increases and climate change : What is the relationship between population increases and climate change? Do you think fertility control is an effective strategy to halt climate change?
What type of vendor support you need after implementation : What type of vendor support and vendor maintenance will you need after implementation? How long will this be needed? Write 5 questions that your facility can.
Determine enterprise areas of security responsibility : Determine the specific enterprise areas of security responsibility and conduct some research into the relevant security controls and measures

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd