Course Info
Policies
Schedule
Homework
Labs
Exams
Lectures

TA Office hours

Gallery

 

For all the Ruby newbies this is how you can get the openssl library to work
(even in the labs).

Check to see if openssl is installed by doing the following:
1. irb
2. require 'openssl'
If you get an error at this point you have to install openssl.


To install openssl for ruby do the following:
Download the latest openssl library for ruby
1. wget http://savannah.nongnu.org/download/rubypki/ossl-0.1.2.tar.gz
Extract the files
2. tar xvzf ossl-0.1.2.tar.gz
Create the makefile
3. ruby extconf.rb
Now make the library
4. make
copy openssl.so to wherever you are going to create your program. To avoid
path issues (or possible out of laziness) I am just going to create the
script in the same directory I untared from i.e. ossl-0.1.2/.


To use the bignumber part openssl do the following:
(put this in a script or do it in irb)
1. require 'openssl'
2. include OpenSSL
3. bignum = BN.new (or without the above include line 'bignum =
OpenSSL::BN.new')

You can find sample code in the ossl-0.1.2/test/ directory. The API should be
similar to C, C++ API.

Nate Haggard