in reply to Re: Weird error with Cryprt::Blowfish and Crypt::DES
in thread Weird error with Cryprt::Blowfish and Crypt::DES
So the internal strings of Net::SSH::Perl got "infected" with the UTF-8 bit. Seems some of the strings it gets are declared in a "use utf8" area (but are 7bit themselves).Perl: a7 53 64 81 c6 0a 30 b9 C: c2 a7 53 64 c2 81 c3 86 0a 30 c2 b9
Now, as what Net::SSH::Perl gives to Cypher::* are binary data (byte strings) regardless of the input strings (character strings), how would I best fix that?
I see three possibilities:
1) Fix Net::SHH::Perl to make a difference between character strings it gets and the byte strings it uses to build the SSH protocol in it.
2) Change our code to disable the UTF8 bit on every string that is given to Net::SSH::Perl.
3) Change Crypt::* to turn the UTF8 bit off on data that is 8 characters long.
I'd say #1 would be the cleanest way and #3 the fastest. As we have a deadline of this afternoon for a complete program run, I will implement #3 as a workaround fast. But, what should we do on the long run?
BTW: Thank you to all who helped, tried to help, or would have helped if they could.
HELP, How DO I do this? I've got the String as above labeled 'Perl' with UTF8 on. When I just disable the flag, I get the 'bad' String, as labelled with 'C'. So how do I convert that string to a string of 8 bytes with the values as they should be?
Ok, I found that, too. utf8::downgrade($data);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Weird error with Cryprt::Blowfish and Crypt::DES
by Anonymous Monk on Jul 25, 2008 at 17:36 UTC | |
by Anonymous Monk on Aug 28, 2008 at 19:45 UTC | |
by Anonymous Monk on Mar 03, 2009 at 11:33 UTC | |
by Corion (Patriarch) on Mar 03, 2009 at 11:37 UTC | |
by Anonymous Monk on Mar 03, 2009 at 12:45 UTC | |
by dfmatt (Initiate) on Mar 03, 2009 at 12:48 UTC | |
|
Re^3: Weird error with Cryprt::Blowfish and Crypt::DES
by druidmatrix (Acolyte) on May 07, 2010 at 04:42 UTC |