I want to implement brute force hacking using RSA. How can I simulate and measure time duration? What software (or software-based simulator) would be needed?
Firstly, I assume we are talking about classical computers
Implementing a brute force attack on a RSA may not be the most sensible thing, unless of course the security parameter of your target system is small.. (160 bit numbers! )
Even then you may not want to implement a brute force here.. try using Fermat's Factoring or Pollards $\rho$ method.
If you just want to measure time try to do a more theoretical research, i.e. use the time take per multiplication op. and the no. of operations your computer can perform in a sec to determine exactly how long will it take you to brute force a $n-$bit security.
To sum it up, YOU CANNOT BRUTE FORCE THE (properly implemented) MODERN DAY RSA (~4096 bit numbers) even if you use all computers in your state.
I don't understand what you mean simulate, but if you need a toy example in python the code is at the end of the message.
If you need to show the performance of more advanced algorithms use
factor(x) in pari/gp. See here for details.
import gmpy, time, random, math def genprime(bits): p=1 while(gmpy.is_prime(p)==0): p = random.randrange(math.pow(2,bits-1),math.pow(2,bits)) return p BITS=20 found=False p=genprime(BITS) q=genprime(BITS) n=p*q cnt=2 s_time=time.time() while not found: found=(n%cnt==0) cnt+=1 e_time=time.time()-s_time if found: print "%d can be devided by %d"%(n, cnt-1) print "It took %d ms "%(cnt-1)