Mark Van Orman wrote:
> Hi,
> 
>     Not even sure if this is the right place to ask this quesion, but 
> here goes anyway. Please advise me of the right place to do so in case 
> this isn't.
> 
>     I need to be able to encrypt data using TDES in ECB mode. I couldn't 
> find any Ruby libs that do that do that. Does anyone know of one that's 
> being developed?
> 

You can use the OpenSSL module to access a lot of different cipher 
algorithms. I'm not sure how "TDES in ECB mode" maps to the OpenSSL 
names for the algorithms, but there is one (at least on my machine) 
called "des-ecb". If you have OpenSSL installed you can probably type 
"openssl -h" at the command prompt and it will spit out a list of 
available ciphers and digests.

If any of those are suitable, you can use them in Ruby like so:

   require 'openssl'

   cipher = OpenSSL::Cipher::Cipher.new( "des-ecb" )
   cipher.encrypt
   cipher.key = key_to_use
   cipher.iv = iv_to_use

   output = cipher.update( data_to_encrypt )
   output << cipher.update( more_data_to_encrypt )
   output << cipher.final

Or, to decrypt:

   cipher = OpenSSL::Cipher::Cipher.new( "des-ecb" )
   cipher.decrypt
   cipher.key = key_to_use
   cipher.iv = iv_to_use

   output = cipher.update( data_to_dencrypt )
   output << cipher.update( more_data_to_dencrypt )
   output << cipher.final

(Hopefully someone will correct me if I provided any incorrect 
information above...) Hope that helps,

Jamis

> 
> 
> Thanks,
> 
> Mark
> 
> .
> 


-- 
Jamis Buck
jgb3 / email.byu.edu
http://www.jamisbuck.org/jamis

"I use octal until I get to 8, and then I switch to decimal."