Question

In: Statistics and Probability

(Birthday attack) A birthday attack is a type of cryptographic attack that exploits the mathematics behind...

(Birthday attack) A birthday attack is a type of cryptographic attack that exploits the mathematics behind the birthday problem in probability theory. It can be used to find collisions in a cryptographic hash function. Suppose that we have a hash function which, when supplied with a random input, returns one of 256 equally likely values. The attack generates n random inputs, supplies them into the hash function, and obtains n returned values (each is chosen from the 256 possible values uniformly at random). Use MATLAB or other programming language, compute and plot the probability of at least two returned values being the same (i.e., collision happens), for n = 1 to 30. (Submit your math formula, the code, and a nice-looking plot.)

Solutions

Expert Solution

The probability values that at least 2 birthdays match (for n = 1:30) are:

   0.00000
   0.00240
   0.01080
   0.02960
   0.03960
   0.06360
   0.07440
   0.10560
   0.12920
   0.14560
   0.18960
   0.23360
   0.27560
   0.30320
   0.33680
   0.37280
   0.42000
   0.45640
   0.49480
   0.55360
   0.57240
   0.61120
   0.64520
   0.67840
   0.68960
   0.71400
   0.75960
   0.78080
   0.79440
   0.83960

Matlab code for above result:

K = 2500;
% Loop K times
for jj = 1:K

% iterations for different n
for n = 1:30
% birthday values array
bd = ceil(256*rand(1,n));
% sort bd values
bd_sorted = sort(bd);
% initialise flag variable (flag = 1 if bd values clash)
flag(jj,n) = 0;
% check if bd values clash
for ii = 1:n-1
if (bd_sorted(ii) == bd_sorted(ii+1))
flag(jj,n) = 1;
end
end
end
end
disp(transpose(mean(flag)));

plot(flag);


Related Solutions

Describe how the Heartbleed attack happens. What is the type of this attack? Where does the...
Describe how the Heartbleed attack happens. What is the type of this attack? Where does the vulnerability exist? Describe the vulnerability and how it is exploited? Describe the consequences of the attack?
Physics principles behind the use of induction type instruments
Physics principles behind the use of induction type instruments
find some type of combuter attack that happend. and include a good explanation for these questions:...
find some type of combuter attack that happend. and include a good explanation for these questions: who dose the attack? what was the attack, and what was taken? where did that happen ? how did that happen ? why did it happen ? why did I pick this type of attack ?
full theory and mathematical derivatives behind induction type Instruments
full theory and mathematical derivatives behind induction type Instruments
A successful attack to the Internet DNS would be devastating. Explain what type of attacks can...
A successful attack to the Internet DNS would be devastating. Explain what type of attacks can be made towards DNS. Why, to-date, such attacks in practice have not been successful? In your answer, you should consider caching in particular. Why such technique has not only proven to provide better performance, which is its original goal, but also protection against security attacks.
1). Type II diabetes may result from         a). obesity, b). autoimmune attack on alpha cells, c)....
1). Type II diabetes may result from         a). obesity, b). autoimmune attack on alpha cells, c). autoimmune attack on beta cells, d). autoimmune attack on alveolar epithelial cells, e). none of the above 2).  In what week of human development does gastrulation occur?        a). first, b). fourth, c). third, d). second, e). fifth 23).  The wet form of macular degeneration may be slowed by       a). lycopene,  b). vitamin K, c). lutein, d). anti-VEGF drugs, e). c and d
a full elaborate explanation on the theory behind induction type Instruments including calculations pertaining to them...
a full elaborate explanation on the theory behind induction type Instruments including calculations pertaining to them mathematical derivations
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT