Strange problem when using crypt


#1

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?

Thanks,
Toby


#2

What OS? What ar eyou using to open the file?

On Jul 30, 8:10 am, “removed_email_address@domain.invalid” removed_email_address@domain.invalid


#3

Sorry should have been more explicit - I’m on OS X and I’m using
TextMate.

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.”