Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^6: STDERR Restore after redirect

by tultalk (Monk)
on Apr 28, 2018 at 23:47 UTC ( [id://1213747]=note: print w/replies, xml ) Need Help??


in reply to Re^5: STDERR Restore after redirect
in thread STDERR Restore after redirect

Hi. Thanks all. Moving on to the STARTTLS mode.

If I should start new topic, warn me.

AUTH PLAIN failed: 554 Security failure
Server said: 554 Security failure

MIME::Base64 encode/decode

my $encodedString = "AUTH PLAIN " . encode_base64(join("\0", $auth->{user}, $auth->{ +user}, $auth->{password}), $CRLF); my $decodedString = decode_base64($encodedString) +; warn("decodedString '$decodedString'");

Encode produces:

AUTH PLAIN d2VibWFzdGVyXEBid21qY20udXMAd2VibWFzdGVyXEBid21qY20udXMAd21 +ANDA5MTNXTQ==

Decode produces:

D<5ݕѕqݵݕѕqݵݵ ]4

I thought the decoded string would be that same as the input string.No?

Replies are listed 'Best First'.
Re^7: STDERR Restore after redirect
by AnomalousMonk (Archbishop) on Apr 29, 2018 at 01:30 UTC

    Why would prepending  "AUTH PLAIN " to the encoded string leave the encoding unchanged so that decoding would remain symmetric?

    c:\@Work\Perl\monks>perl -wMstrict -le "use MIME::Base64; ;; use Data::Dump qw(pp); ;; my $encoded = encode_base64('Aladdin:open sesame'); ;; my $decoded = decode_base64($encoded); print qq{A: '$decoded'}; ;; $encoded = 'AUTH PLAIN ' . $encoded; $decoded = decode_base64($encoded); print 'B: ', pp $decoded; " A: 'Aladdin:open sesame' B: pack("H*","0144c73cb0083505b1859191a5b8e9bdc195b881cd95cd85b594")

    Update: And yes, this does look like a bit of a new topic...


    Give a man a fish:  <%-{-{-{-<

      Hi. Thanks.

      Why would prepending "AUTH PLAIN " to the encoded string leave the encoding unchanged so that decoding would remain symmetric?

      Because I was not paying attention. Fixed

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1213747]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2026-01-15 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.