Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Let[m]denote the set{0,1,,m1}. For each of the following families of hash functions, say whether or not it is universal, and determine how many random bits are needed to choose a function from the family.

(a) H={ha1,a2:a1,a2[m]}, wheremis a fixed prime and

ha1·ha1,a2(x1,x2)=a1x1+a2x2modm

Notice that each of these functions has signatureha1,a2:[m]2[m]that is, it maps a pair of integers in[m]to a single integer in[m].

(b) His as before, except that nowm=2kis some fixed power of.2

(c) His the set of all functionsf:[m][m1].

Short Answer

Expert verified

a) It is proved that given family of hash functions,His universal.

b) It is required to choose two integers, the total number of random bits required to select a hash function is2kbits.

c) mlog(m1)bits required to choose a function fromH.

Step by step solution

01

To prove that the family of hash function His universal

(a)

H={ha1,a2:a1,a2[m]}andha1,a2=i=12ai.ximodm=(a1x1+a2x2modm)

Assume thatx2y2.

Now, to proveH={ha1,a2:a1,a2[m]}is universal, it is required to find the probability

Pr[ha1,a2(x1,x2)=ha1,a2(y1,y2)]

Re write the above equation as follows:

a1(x1y1)a2(y2x2)modm

Selecta1randomly from[m] and assumec=a1(x1y1).

Thena2c.(y2x2)1modm,

Now calculate the probability of selectingso that Equation(1)is true.

Thusa2c.(y2x2)1modmand obviouslycan be any one of the integers in.{0,1,,m1} That isa2,havepossible values.

Therefore, the probability of equation (1)holds is1m.

Hence it is proved that given family of hash functions,His universal.

02

Total number of random bits required to select a hash function is2k bits

(b)

Consider a family of hash functionsH={ha1,a2:a1,a2[m]} and

ha1,a2=i=12ai.ximodm=a1x1+a2x2modm

Wherem=2k(That is,mis even).

From part (a)H,is universal and(a1x1+a2x2)(a1y1+a2y2)modmholds when there exists a unique inverse modulomfor (y2x2).

There will be a unique inverse modulomfor (y2x2), only ifmis a prime number.

Sincem=2kand it is not a prime number (unlessk=1), there exist no unique inverse modulomfor.

(y2x2)

ThusH,is not universal.

In order to select a hash function randomly from,H need to select two integers

a1and a2randomly from.[m] The set [m]has totalintegers.

To uniquely represent each number in set,[m] at mostlogmbits are required

Where,

logmbits=log2k=kbits.

Since it is required to choose two integers, the total number of random bits required to select a hash function is2k bits.

03

mlog(m−1)bits required to choose a function from HH

(c)

Consider a family of hash functionsf:[m][m1].

In order to prove the above family of hash functions is universal, it is enough to prove that the probability of colliding any two data itemsxand yis1m1, if the hash function is randomly chosen from the family of hash functions. Wherem1is the number of buckets.

Assumexyand then calculateP=Pr[f(x)=f(y)].

The probability forf(x) can be any one of integers of[m1] is1m1.

Similarly, the probability forf(y)can be any one of integers of [m1]is.1m1

The probability for the outputs off(x)and f(y)are same is.data-custom-editor="chemistry" 1m1×1m1=1(m1)2

However, there arem1ways to be.f(x)=f(y)

That is(f(x)=0,1,2,,m2)=(f(y)=0,1,2,m2),(totalm1ways)

Thus,P=i=1m11(m1)2

or

P=(m1)×1(m1)2P=1m1

Therefore, it is proved thatHis universal.

Set [m]={0,1,2,,m1}can be mapped to set [m1]={0,1,2,,m2}in(m1)mways such that fis a function.

Thus, the total number of functions f:[m][m1]is(m1)m.

To uniquely represent each function inH, at most log(m1)m=mlog(m1)bits are required.

Therefore,mlog(m1)bits required to choose a function fromH.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Show that if ab(modN)and if M Divides Nthenab(modM)

A positive integer N is a power if it is of the formqk , where q,role="math" localid="1658399000008" k are positive integers and k>1.

(a) Give an efficient algorithm that takes as input a number and determines whether it is a square, that is, whether it can be written asq2 for some positive integer q. What is the running time of your algorithm?

(b) Show that if N=qk (with role="math" localid="1658399171717" N,q , andk all positive integers), then either role="math" localid="1658399158890" klogNorN=1.

(c) Give an efficient algorithm for determining whether a positive integerN is a power. Analyze its running time.

RSA and digital signatures. Recall that in the RSA public-key cryptosystem, each user has a public key P=(N,e) and a secret key d. In a digital signature scheme, there are two algorithms, sign and verify. The sign procedure takes a message and a secret key, then outputs a signature σ. The verify procedure takes a public key (N,e), a signature σ, and a message M, then returns “true” if σcould have been created by sign (when called with message M and the secret key (N, e) corresponding to the public key ); “false” otherwise.

(a)Why would we want digital signatures?

(b) An RSA signature consists of sign, (M,d)=Md(modN)where d is a secret key and N is part of the public key . Show that anyone who knows the public key (N,e)can perform verify ((N,e),Md,M), i.e., they can check that a signature really was created by the private key. Give an implementation and prove its correctness.

(c) Generate your own RSA modulus, N=pq public key e, and private key d (you don’t need to use a computer). Pick p and q so you have a 4-digit modulus and work by hand. Now sign your name using the private exponent of this RSA modulus. To do this you will need to specify some one-to-one mapping from strings to integers in [0,N-1]. Specify any mapping you like. Give the mapping from your name to numbers m1,m2,...mk,then sign the first number by giving the value md1(modN), and finally show that .

(md1)e=m1(modN)

(d) Alice wants to write a message that looks like it was digitally signed by Bob. She notices that Bob’s public RSA key is (17,391). To what exponent should she raise her message?


Show that in any base b2, the sum of any three single-digit numbers is at most two digits long.

Alice and her three friends are all users of the RSA cryptosystem. Her friends have public keys (Ni,ei=3),i=1,2,3 where as always,Ni=piqi for randomly chosen n-bit primes piqi. Showthat if Alice sends the same n-bit message M (encrypted using RSA) to each of her friends, then anyone who intercepts all three encrypted messages will be able to efficiently recover M.
(Hint: It helps to have solved problem 1.37 first.)

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free