I have an assignment of implementing RSA for my cryptography course. One of the requirements is to plot the encryption time vs size of n, where n is the product of two large primes p and q
in bits. Now I have this
benchmarks ::ByteString-> [(Int,ByteStrings)]
benchmarks str = zip keySizeList cipherTexts
smallestKeySize = calcKeySize testStringInt
keySizeList = [smallestKeySize + 1 .. 10 * smallestKeySize]
primePairs = [genPrimePairs nbits | nbits <- keySizeList]
cipherTexts = [rsaEncryptionVsTime str (p, q) | (p, q) <- primePairs]
-- genPrimes, generates a pair of primes
-- smallestKeySize, the smallest integer i such that testStringInt < 2^i.
-- keySizeList , a list of integers denoting the number of bits in n, where n=p*q, p,q are two primes.
-- testStringInt, the integer representation of strings is a number in base 256
-- rsaEncryptionVsTime, is a function that calculates {e,n}, the public key, then calls encrypt
How can I obtain a list of encryption time vs key size in a form that can be plotted, and how can I plot it?