J
Jamis Buck
This is just an update on my last message. I managed to figure out how
to use the OpenSSL ciphers to do the encryption/decryption--took a
little doing, but once I figured it out it was almost ridiculously easy.
For future reference, here's how you do it:
require 'openssl'
require 'base64'
cipher = OpenSSL::Cipher:ES.new
password = "hullabaloo"
cipher.encrypt( password )
result = cipher.update( "some text to encrypt" )
result << cipher.final
puts encode64( result )
cipher.decrypt( password )
result = cipher.update( result )
result << cipher.final
puts result
If anyone has any suggestions for doing it better, please let me know.
--
Jamis Buck
(e-mail address removed)
http://www.jamisbuck.org/jamis
ruby -h | ruby -e
'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a <<
r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"'
to use the OpenSSL ciphers to do the encryption/decryption--took a
little doing, but once I figured it out it was almost ridiculously easy.
For future reference, here's how you do it:
require 'openssl'
require 'base64'
cipher = OpenSSL::Cipher:ES.new
password = "hullabaloo"
cipher.encrypt( password )
result = cipher.update( "some text to encrypt" )
result << cipher.final
puts encode64( result )
cipher.decrypt( password )
result = cipher.update( result )
result << cipher.final
puts result
If anyone has any suggestions for doing it better, please let me know.
--
Jamis Buck
(e-mail address removed)
http://www.jamisbuck.org/jamis
ruby -h | ruby -e
'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a <<
r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"'