From ruby-talk Tue Nov 27 15:05:20 2007 From: "Caleb Tennis" Date: Tue, 27 Nov 2007 15:05:20 +0000 To: ruby-talk Subject: Re: Problems with OpenSSL => RSA Message-Id: <56277.192.168.2.159.1196175811.squirrel () www ! aei-tech ! com> X-MARC-Message: https://marc.info/?l=ruby-talk&m=119617598614134 > It doesn't work :-( The error message doesn't make sense to me, so > I'm hoping someone can enlighten me. Maybe I'm not using the > libraries correctly. Thanks for the help. There's a good explanation here: http://stuff-things.net/2007/06/11/encrypting-sensitive-data-with-ruby-on-rails/ The last paragraph is what you're looking for. Basically, you can only encrypt a message with length up to your key size in bytes (128) - 11 for padding, which is 117 bytes. Depending on your total message size, you'll have to either use a bigger key (which will make the encrypt/decrypt slower) or use a different encryption/decryption model. Caleb