
144 Cryptography with Open-Source Software
sage: n = 10
sage: s = [randrange(10,1000) for i in range(n)]
sage: N = add(random_sublist(s,0.4))
sage: %time subsetsum(s,N)
Experiment with longer lists, 15, 20, 25, 30, a nd more elements. When
do you start to see a significant wait in executio n time?
38. Now do the same thing with random super-increasing lists:
sage: s=[]
sage: for i in range(n):
....: s+=[sum(s)+randrange(1,10)]
sage: N = add(random_sublist(s,0.4))
sage: si_solve(s,N)
Try very large values of n: 100, 200. Does this affect the execution time?
39. Use Sage to follow through the first Merkle–Hellman multiplicative ex-
ample given on page 133.
40.