tobyclemson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-30 15:10 UTC
Strange problem when using crypt.
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
What OS? What ar eyou using to open the file? On Jul 30, 8:10 am, "tobyclem...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <tobyclem...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
tobyclemson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-30 15:49 UTC
Re: Strange problem when using crypt.
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." <christopher.e.frank...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What OS? What ar eyou using to open the file? > > On Jul 30, 8:10 am, "tobyclem...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <tobyclem...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---