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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With