Updated encryption.
Added testing with rspec.