Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can anyone figure out a java program for this problem here? This problem introduces a hash function that operates on letters instead of binary data.

Can anyone figure out a java program for this problem here? This problem introduces a hash function that operates on letters instead of binary data. Given a message consisting of uppercase letters, the hash function produces a hash value consisting of four letters. First, it divides the message into blocks of 16 letters, ignoring spaces, numbers and punctuation. In fact, all characters, other than letters, should be ignored. And all lowercase letters should be converted to uppercase letters. The messages should be a maximum of 80 characters. If the message length is not divisible by 16, it is padded out with the letter A. A four-number running total is maintained that starts out with the value (0, 0, 0, 0); this is input to a function, known as a compression function, for processing the first block. The compression function consists of two rounds. Round 1: Get the next block of text and arrange it as a row-wise 4 * 4 block of text and covert it to numbers (A = 0, B = 1, etc.). Example: For the block SOFTWARE ENGINEERING TERM PROJECT!, we have Then, add each column mod 26 and add the result to the running total, mod 26. In this example, the running total is (5, 5, 6, 22). Round 2: Using the matrix from round 1, rotate the first row left by 1, second row left by 2, third row left by 3, and reverse the order of the fourth row. In our example, we get Now, add each column mod 26 to get (4, 17, 6, 11); and add the result to the running total, mod 26. The new running total is now (9, 22, 12, 7). This running total is now the input into the first round of the compression function for the next block of text. Round 1 for the Second Block of text is as follows: The running total is now: (14, 7, 13, 19). Round 2 for the Second Block of text is as follows: The running total is now: (17, 19, 17, 3). After the final block is processed, convert the final running total to letters. For the running example, if the message is SOFTWARE ENGINEERING TERM PROJECT!, then converting (17, 19, 17, 3) to letters yields the hash value of RTRD.

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

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions

Question

LO3 Discuss the steps of a typical selection process.

Answered: 1 week ago