Forum: Ruby on Rails Strange problem when using crypt.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
on 2007-07-30 19:10
(Received via mailing list)
Hi there,

I'm trying to utilise the crypt/rijndael algorithm in rails. I've
written a small script separate from rails that takes a string and
using a specified key encrypts it and saves it to a file.

I then would like to be able to copy the string in that file and paste
it into my rails application source and decrypt it using the
decrypt_block method of rijndael.

The trouble is the string changes between the file and the pasted text
in rails. I mean it looks that same but if I puts it out from rails it
is different. I think this must be a character encoding problem but
I'm not sure...

Does anyone have any ideas?

Christopher E. Franklin, Sr. (Guest)
on 2007-07-30 19:46
(Received via mailing list)
What OS? What ar eyou using to open the file?

On Jul 30, 8:10 am, "removed_email_address@domain.invalid" 
on 2007-07-30 19:50
(Received via mailing list)
Sorry should have been more explicit - I'm on OS X and I'm using

After playing around I've found that if I save the file using MacRoman
as the character encoding it works the way I expected.

Nonetheless I'd like to know a way of doing it even if the file is
saved in UTF-8.

On Jul 30, 4:45 pm, "Christopher E. Franklin, Sr."
This topic is locked and can not be replied to.