
292 Cryptography with Open-Source Software
Sage Exercises
25. Mars orbits the sun and rotates in such a way that there are 668 Mar-
tian days in a Martian year. How many Martians are required so the
probability that two of them share a birthday is (a) 0.5 ? (b) 0.9?
26. Use the simplified MASH (SMASH) of q uestion 23 as follows: for a
message m, considered as a large integer, define y
i
to be the “digits” of
m in base n. This can be obta ined in Sage with
sage: y = m.digits(n)
Define
sage: p = next_prime(2^40)
sage: q = next_prime(3^26)
Use these values to hash the phrase:
Now is the winter of our discontent made glorious summer
by this sun of York.
and use the ...