[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: openssl Vs perl encode



Hi,

Bhasker C V <bhasker@unixindia.com> writes:

>  I am trying to encode using base64 to get data for SMTP
> authentication which i am experimenting upon. I stumbled upon this
> issue. I am not sure why this is happening.
>
>  Say the text to be encoded is  "help@base.com"
>
>  $ perl
> use MIME::Base64;
> print encode_base64("help@base.com");
> aGVscC5jb20=

Perl understands the "@base" as an array here.  So you only encode
"help.com" in base64.  Use ' instead of " and you get

    aGVscEBiYXNlLmNvbQ==

> $ echo "help@base.com" | openssl base64
> aGVscEBiYXNlLmNvbQo=

Now the only difference is the new-line produced by echo.

Regards,
Ansgar

-- 
PGP: 1024D/595FAD19  739E 2D09 0969 BEA9 9797  B055 DDB0 2FF7 595F AD19


Reply to: