From: Francis Cianfrocca Date: 2006-08-11T22:50:23+09:00 Subject: Re: Cryptographic Signatures: Ruby versus OpenSSL ------=_Part_121271_1727515.1155304220158 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline This Ruby code will give you the same result: #-------------------------------------------------- require 'base64' require 'openssl' require 'sha1' include OpenSSL include PKey include Digest pkey = RSA.new(File.read("private.pem")) plaintext = SHA1.new( "Some Text" ).digest enc = pkey.private_encrypt(plaintext) puts Base64.encode64(enc) #-------------------------------------------------------- as this: echo -n "Some Text" | openssl dgst -sha1 -binary | openssl rsautl -sign -inkey private.pem | openssl enc -base64 ------=_Part_121271_1727515.1155304220158--