当前位置:天才代写 > 作业代写 > hash function代写 One-Way Property代写 Collision-Free Property代写

hash function代写 One-Way Property代写 Collision-Free Property代写

2020-09-15 17:15 星期二 所属: 作业代写 浏览:9

hash function代写

One-Way Property versus Collision-Free Property

hash function代写 In this project you will investigate the difference between hash function’s two distinctive properties: one-way property

In this project you will investigate the difference between hash function’s two distinctive properties: one-way property and collision-free property. You are required to use the brute-force method to see how long it takes to break the hash generated using each of these properties. Instead of using openssl’s command-line tools, you are required to update the C programs provided to invoke the message digest functions in openssl’s crypto library. A sample code can be found at the following link, it would be helpful to familiarize with the sample code:

http://www.openssl.org/docs/crypto/EVP_DigestInit.html.hash function代写

Since most of the general hash functions are quite strong against the brute-force

hash function代写
hash function代写

attackconducted on those two properties, it can take years to break them using brute-force. Hence, to make the task feasible we reduce the length of the hash value to 24 bits. You can use any one- way hash function, but only the first 24 bits of the hash value generated will be used in this task. As explained, we are using a modified one-way hash function.hash function代写

“Oneway” means that given a function output, you cannot find a matching input, except by trying many potential inputs and getting lucky. A collision is about finding two distinct inputs which yield the same output, without any predefined constraint on said output.

You must complete the code and run it to find out the following:
  1. Howmany trials it will take you to break the one-way property using the brute-force method? You should repeat your experiment for multiple times and report your average number of trials.
  2. How many trials it will take you to break the collision-free property using the brute-force method? Similarly, you should report the
  3. Based on your observation, which property is easier to break using the brute-forcemethod?hash function代写

There are two skeleton programs i.e. oneway.c and collision.c provided foe this assignment. You aim is to complete the code, run it successfully and observe which property is easier to break using the brute-force method.

The character set to be used is as follows:

0123456789! \”#$%&'()*+ -/. ABCDEFGHIJKLMNOPQRSTUVWX YZabcdefghijklmnopqrstuvwxyz

1. Brute force one-way property break hash function代写

The program’s objective is to hit a “target” hash value by generating the hash for different strings and matching it with the target hash value.

The approach to generate strings and match them against a target is implemented as follows:

  1. Start with string length 1
  2. Generate all possible combinations of strings for current length using the character set, generate its hash and compare it with the target
  3. If a match is found, the execution stops and reports the number of iterations
  4. Ifno match is found in all possible strings of current length, increment length by ‘1’ and go to step (2)

The brute force code is used in the one way property break program oneway.c to generate strings In a systematic manner, exhausting all possibilities for a given length (starting with 1), and incrementing the length if no match was found. You can refer to oneway.c program for 77 characters to be used for further processing in one way property.hash function代写

The oneway.c should be executed a minimum of five times to find out the average number of tries required to match the target hash.

2. Bute force collision free property break

In the case of collision free property, there is no restriction on target hash. The approach followed in the collision.c program to break this property is as follows:

  1. Allocated an array for saving hashvalues
  2. Generate initial message (call itM)
  3. Find M’shash
  4. Generate random string and find itshash
  5. Compare hash from (4) to M’s hash, if a match is found then exit and report thenumber of iterations used.
  1. Compare hash from (4) to each hash value in array, if any match is found then exit and report the number of iterationshash function代写
  2. If no match is found, save the hash from (4) into the array and go to step(4)

To break the collision free property, you just need to find two messages with matching hash values. Matching the random string’s hash value to an initial hash as well as saved hash value (in the array) increases the probability of finding hash value with less number of iterations.hash function代写

Execute the collision.c program five times to find the average number of iteration required.

Instructions for compiling and running the program: hash function代写

To compile:

$ gcc –o oneway oneway.c –lcrypto –ldl –std=c99

$ gcc –o collision collision.c –lcrypto –ldl –std=c99

To run the code:

$ ./oneway md5

$ ./collision md5

Marking Criteria:

Total Weightage: 20% hash function代写

Criteria Incomplete Work Partial Work Full Work
 

Program Completeness

0 Points

 

Program Submitted without any changes

4 Points

 

Program Modified, but missing certain components

7 Points

 

Program contains all essential components.

 

Program Functioning

0 Points

 

Program does not compile / run

3 Points

 

Program calculates ciphertext but can’t find a match

5 Points

 

Program calculates ciphertext and finds a match

 

Demo and Questionnaire

0 Points

Unable to answer questions.

4 Points

Able to partially answer the questions.hash function代写

8 Points

 

Able to answer all questions.

hash function代写
hash function代写

更多其他:  assignment代写 C++代写  代码代写 作业代写  code代写 java代码代写  C++代写 C语言代写 算法代写 程序代写

合作平台:天才代写 幽灵代写  写手招聘 Essay代写

 


天才代写-代写联系方式