I'm writing an implementation of a diffie-hellman key exchange in ruby for a project for one of my university classes. I need to generate large (secure) prime numbers of at least 500 bits length. Any ideas? Should I use the OpenSSL library? If so, what functions would you recommend?
Use the openssl gem
OpenSSL::BN::rand
You can specify the size you need - like so OpenSSL::BN::rand(212)