In: Computer Science
Creating SHA-1 Hashes. Provide a screenshot for each of questions 3a – 3d.
a. Create a SHA-1 hash of your last name using the code on page 43 in your lab book. Put your name in all lowercase letters. Is the MD the same length as your last name? (20 points)
b. Using the up arrow, change the first character of your last name to be an uppercase letter. Changing one character in your last name changes how many characters in the MD? (20 points)
c. Create a SHA-1 hash for the following text: Itwasthebestoftimesitwastheworstoftimesitwastheageofwisdomitwastheageoffool ishnessitwastheepochofbeliefitwastheepochofincredulityitwastheseasonoflightitwasthes easonofdarknessitwasthespringofhopeitwasthewinterofdespair (20 points)
d. Compare the length of this MD with the MD of your last name. What conclusions can you draw from the MDs? (20 points)
Here is the snippet of the code that is used to create the Message Digest for the SHA-1 Hashing algortihm.
Note: Since no code is provided to calculate, the Crypto library in nodeJS is used to create the MD for the string.
//importing the crypto library
var crypto = require('crypto');
//creating hash object
var hash = crypto.createHash('sha1');
//input string
data = hash.update('sutariya', 'utf-8');
//Creating MD in hex
generate_hash= data.digest('hex');
//Printing the output
console.log("hash : " + generate_hash);
Question-1)
Ques-2 )
Ques-3)
Question-4)