Question

7. Someone shows you the hash function that appears below and claims that it meets all...

7. Someone shows you the hash function that appears below and claims that it meets all of the criteria for a good hash function; however, you disagree. Briefly explain why you disagree.
Given that X = (X0, X1, X2, ..., X[n - 1]) where each Xi is a byte.

h(X) = (X0 + X1 + X2 + ... + X[n - 1]) mod 256

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Collision resistance: A good hash function has to produce different output for similar strings (i.e, the characters are same but arrangement is different). The above hash function doesn't meet this condition. Suppose we have 123 and 321 both these will have the same hash function output if we use the above function

So the above function doesn't provide collision resistance

2. Second preimage resistance: Two different inputs should not produce the same hash output

Suppose we have a string whose sum of bits equals 256 and another string whose sum of bits is 512, both the strings will give a hash function output of 0

Hence the above hash function fails second preimage resistance also

So it's not a good hash function

Add a comment
Know the answer?
Add Answer to:
7. Someone shows you the hash function that appears below and claims that it meets all...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Part 5. Suppose that your hash function resolves collisions using the open addressing method with double...

    Part 5. Suppose that your hash function resolves collisions using the open addressing method with double hashing. The double hashing method uses two hash functions h and h'. Assume that the table size N = 13, h(k) = k mod 13, h'(k) = 1 + (k mod 11), and the current content of the hash table is: 0 1 2 3 6 7 8 9 10 11 12 4 17 5 98 If you insert k = 14 to this...

  • You have a hash table of length 7 (tablesize 7). You are given a hash function...

    You have a hash table of length 7 (tablesize 7). You are given a hash function f(x)-x % tablesize, where x is the value to be hashed and fix) is the hash address. Quadratic probing is used to resolve the collisions. The hash function receives the input 40, 26, 15, 12, 5, 17) in that order. Place each number in hash table in its correct address. The first two values are already placed in their correct positions If there isn't...

  • 2. (10 points.) The procedure HASH-SEARCH takes a hash table T[O : m-1) and a key...

    2. (10 points.) The procedure HASH-SEARCH takes a hash table T[O : m-1) and a key k as its parameters. Each element of T is either a key or NIL. The procedure searches for k in T by probing. If it finds k, then it returns the index j where k appears in T. If it cannot find k, then it returns -1. (A procedure very much like HASH-SEARCH is discussed on pages 269–274 of Cormen.) HASH-SEARCH(T, k) i= 0...

  • i need help with 2b please is a set of input values, Y- 2. In this question, we reuse the notation of lecture 37: X-{xi, ,x , m-1) is a set of hash values, and H is an [X → Y)-valued random variab...

    i need help with 2b please is a set of input values, Y- 2. In this question, we reuse the notation of lecture 37: X-{xi, ,x , m-1) is a set of hash values, and H is an [X → Y)-valued random variable {0.1, In lecture, we showed that for any hash value y e Y, the expected number of input values that hash to y is k/m, where k XI and m Yl. However, in determining the time it...

  • Demonstrate how you can construct an Iterative Hash h function using the Merkle- Damgard Design. Use...

    Demonstrate how you can construct an Iterative Hash h function using the Merkle- Damgard Design. Use as your compression function f:{0, 1}^v times {0, 1}^b rightarrow {0, 1}^v, AES with 512-bit keys. Explain what the values of v and b will be in your compression function and where in the block cipher (AES) are you using the blocks of the message you want to hash. Using the iterative hash function you just create above, show how a digest for a...

  • C++ Problem: Please explain the process! You are given a hash function fl(x) : x %...

    C++ Problem: Please explain the process! You are given a hash function fl(x) : x % 5, where x is the value to be hashed and h(x) is the hash address. Double hashing is used to resolve collisions and f2(x)-1 + x 96 4. If you get a collision at ith probe collision is resolved by ( f1(x) + if2(x) )96 5 The hash function receives the input [5, 10, 30, 32, 34 in that order. Place each number in...

  • NOTE: It is a General Equilibrium (GE) question. Please answer all parts of the question. Thanks ...

    NOTE: It is a General Equilibrium (GE) question. Please answer all parts of the question. Thanks for the help. Ш. Consider the two-person, two-good economy given by 띠 (x) = 2011 + x12, wi and u2(x2)2+222 , w- where u讠 : R → R+, xi :-(zil, Xi2), and wi := (wil ,Wi2), i = 1, 2, are person i's utility function, consumption bundle, and endowment of the two goods, respeortively. 1. Find the set of competitive equilibrium allocations and corresponding...

  • 2. One common distribution that appears in branching process theory is a DRV with pmf: fx(x;j)...

    2. One common distribution that appears in branching process theory is a DRV with pmf: fx(x;j) = w. e-h (ux)2–1 — where x E {1, 2, ...} and pi € [0, 1] a. Find the MLE for u given iid X1, ..., Xn. Then, find the MLE for the particular data X1 = 2, X2 = 1, X3 = 6. b. Using Desmos (https://www.desmos.com/calculator), draw a graph of the likelihood function (not log-likelihood) for the data x1 = 2, X2...

  • Can someone please help me with this problem? Thank you in advance! 3. (10 points) Let...

    Can someone please help me with this problem? Thank you in advance! 3. (10 points) Let X1, X2, ... be a sequence of random variables with common uniform distribution on (0,1). Also, let Zn = (11=1 X;)/n be the geometric mean of X1, X2, ..., Xn, n=1,2,.... Show that In , where c is some constant. Find c.

  • 7 points Question 3. An Unusual Integrable Function (Show Working) Consider the function f : 10, ...

    7 points Question 3. An Unusual Integrable Function (Show Working) Consider the function f : 10, 11 → R defined by 1 if r-for some nEN; f(x) = 0 for all other x E [0,1 (1 subpts) (a) Draw a rough diagram of the graph of f. When we study the formal definition of the continuity of a function later in the course, we will be able to prove that this function is discontinuous at those domain values r such...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT