Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: perl - What version is in use ?

  1. #1
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    1,015

    Default perl - What version is in use ?

    Hello.

    It is not a question about BASE64
    My ISP want me to use "SSL / TLS port 465" or "MD5 port 587".
    I started with MD5 port 587.

    Question 1
    ========
    /usr/lib/perl5 contains 3 different perl installations :
    /usr/lib/perl5/5.18.2
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl

    When calling a perl module/function which version is in use ?

    Question 2
    ========
    I use this command
    Code:
    perl -MMIME::Base64 -e 'print encode_base64("some_user");'
    to get a base64 encoded user name or user password.

    I would like to use this command
    Code:
    perl -MXXXXXX::YYYYYY -e 'print ZZZZZZZ("some_user");'
    to get a md5 encoded user name or user password.
    I have tried different command flavor with no success.
    Code:
         ~> perl -MDigest::MD5 -e 'print encode_base64("some_user");'
    Undefined subroutine &main::encode_base64 called at -e line 1.
    
    ~> perl -MDigest::MD5 -e 'print md5_base64("some_user");'
    Undefined subroutine &main::md5_base64 called at -e line 1.
    
    ~> perl -MDigest::MD5 -e 'print hmac_md5("some_user");'
    Undefined subroutine &main::hmac_md5 called at -e line 1.
    
    ~> perl -MDigest::HMAC_MD5 -e 'print hmac_md5("some_user");'
    Undefined subroutine &main::hmac_md5 called at -e line 1.
    
    ~> perl -MDigest::MD5 -e 'print md5_base64("some_user");'
    Undefined subroutine &main::md5_base64 called at -e line 1.
    
    ~> perl -MDigest::MD5 -e 'print hmac_md5("some_user");'
    Undefined subroutine &main::hmac_md5 called at -e line 1.
    
    ~> perl -MDigest::MD5 -e 'print md5("some_user");'
    Undefined subroutine &main::md5 called at -e line 1.

    Code:
        ~> perl -e 'use HMAC_MD5;'
    Can't locate HMAC_MD5.pm in @INC (you may need to install the HMAC_MD5 module) (@INC contains: /usr/lib/perl5/site_perl/5.18.2/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.18.2 /usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.18.2 /usr/lib/perl5/5.18.2/x86_64-linux-thread-multi /usr/lib/perl5/5.18.2 /usr/lib/perl5/site_perl .) at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.

    Code:
    ~> perl -e 'use MD5;'
    Can't locate MD5.pm in @INC (you may need to install the MD5 module) (@INC contains: /usr/lib/perl5/site_perl/5.18.2/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.18.2 /usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.18.2 /usr/lib/perl5/5.18.2/x86_64-linux-thread-multi /usr/lib/perl5/5.18.2 /usr/lib/perl5/site_perl .) at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.
    But HMAC_MD5.pm is in "/usr/lib/perl5/vendor_perl/5.18.2/Digest"
    and MD5.pm is in "/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi/Digest" or in "/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/Digest"

    Any help is welcome
    Thanks for helping. JCD
    __________

    server leap 15-- ASUS g75vw KDE leap 42.3 -- ASUS g750JZ KDE leap 42.3 -- acer aspire s13 win 10 home -- HP Omen win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,816
    Blog Entries
    1

    Default Re: perl - What version is in use ?

    I don't code Perl, but the following will likely be helpful...

    To list your loaded modules,, you'll also likely display the path that describes from which Perl you're running...

    https://perlmaven.com/which-perl-mod...aded-in-memory

    As for your other errors trying to encode, you're fairly obviously passing something that isn't supported when the routine errors out on line 1. You might want to look for examples and documentation for what you're trying to do.

    Last comment,
    The network connections and their ports specified by your ISP look pretty standard. I don't remember for sure at the moment how an MD5 encoded connection is supposed to work, but an SSL/TLS connection is pretty simple, if an automatic key exchange isn't available you should only need to install an authorized certificate and use it to encrypt your connection, thereby "wrapping" your encryption around your content (You don't need to encrypt your content further).

    One other thing...
    If you might want to consider installing a different openSUSE Perl, the following describes the openSUSE package naming convention...

    https://en.opensuse.org/Perl

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,302
    Blog Entries
    15

    Default Re: perl - What version is in use ?

    Quote Originally Posted by jcdole View Post
    Hello.

    It is not a question about BASE64
    My ISP want me to use "SSL / TLS port 465" or "MD5 port 587".
    I started with MD5 port 587.

    Question 1
    ========
    /usr/lib/perl5 contains 3 different perl installations :
    /usr/lib/perl5/5.18.2
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl

    When calling a perl module/function which version is in use ?
    Hi
    Those directories are normal, to test the perl version in use it's;
    Code:
    perl -V
    This will list out the perl summary, perl modules will go into vendor, I see none under site...

    Try;
    Code:
    #!/usr/bin/perl
    
    #qw can be one of md5, md5_hex or md5_base64
    use Digest::MD5 qw(md5);
    
    print "Digest is ", md5("username"), "\n";
    Last edited by malcolmlewis; 30-Dec-2018 at 18:32.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,302
    Blog Entries
    15

    Default Re: perl - What version is in use ?

    Quote Originally Posted by malcolmlewis View Post
    [/INDENT]Hi
    Those directories are normal, to test the perl version in use it's;
    Code:
    perl -V
    This will list out the perl summary, perl modules will go into vendor, I see none under site...

    Try;
    Code:
    #!/usr/bin/perl
    
    #qw can be one of md5, md5_hex or md5_base64
    use Digest::MD5 qw(md5);
    
    print "Digest is ", md5("username"), "\n";
    Hi
    And as your one liner;
    Code:
    perl -MDigest::MD5=md5 -e 'print md5("username");'
    perl -MDigest::MD5=md5_hex -e 'print md5_hex("username");'
    perl -MDigest::MD5=md5_base64 -e 'print md5_base64("username");'
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    1,015

    Smile Re: perl - What version is in use ?

    Quote Originally Posted by malcolmlewis View Post
    Hi
    And as your one liner;
    Code:
    perl -MDigest::MD5=md5 -e 'print md5("username");'
    perl -MDigest::MD5=md5_hex -e 'print md5_hex("username");'
    perl -MDigest::MD5=md5_base64 -e 'print md5_base64("username");'
    Thank you very much.

    I have another question :
    It seems that the result from MIME::Base64 and Digest::MD5=md5_base64 are different.
    Code:
    DIGEST=$(perl -MDigest::MD5=md5_base64 -e 'print md5_base64("username");')
    print $DIGEST
    FMSwa4JOxZMjk2JRf1OLKQ
    Code:
    DIGEST=$(perl -MMIME::Base64 -e 'print encode_base64("username");')
    print $DIGEST
    dXNlcm5hbWU=
    Any comment ?
    Thanks for helping. JCD
    __________

    server leap 15-- ASUS g75vw KDE leap 42.3 -- ASUS g750JZ KDE leap 42.3 -- acer aspire s13 win 10 home -- HP Omen win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

  6. #6
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    1,015

    Default Re: perl - What version is in use ?

    Happy new Year.
    Thanks for helping. JCD
    __________

    server leap 15-- ASUS g75vw KDE leap 42.3 -- ASUS g750JZ KDE leap 42.3 -- acer aspire s13 win 10 home -- HP Omen win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,302
    Blog Entries
    15

    Default Re: perl - What version is in use ?

    Quote Originally Posted by jcdole View Post
    Thank you very much.

    I have another question :
    It seems that the result from MIME::Base64 and Digest::MD5=md5_base64 are different.
    Code:
    DIGEST=$(perl -MDigest::MD5=md5_base64 -e 'print md5_base64("username");')
    print $DIGEST
    FMSwa4JOxZMjk2JRf1OLKQ
    Code:
    DIGEST=$(perl -MMIME::Base64 -e 'print encode_base64("username");')
    print $DIGEST
    dXNlcm5hbWU=
    Any comment ?
    Hi
    Happy New Year back at you

    Well digest is just for accessing the md5 algorithm, the mime one is for encoding/decoding base64 strings? Not sure what your expecting?
    Code:
    perl -MMIME::Base64=encode_base64 -e 'print encode_base64("username");'
    dXNlcm5hbWU=
    
    perl -MMIME::Base64=decode_base64 -e 'print decode_base64("dXNlcm5hbWU=");'
    username
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  8. #8
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    1,015

    Default Re: perl - What version is in use ?

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Happy New Year back at you

    Well digest is just for accessing the md5 algorithm, the mime one is for encoding/decoding base64 strings? Not sure what your expecting?
    Code:
    perl -MMIME::Base64=encode_base64 -e 'print encode_base64("username");'
    dXNlcm5hbWU=
    
    perl -MMIME::Base64=decode_base64 -e 'print decode_base64("dXNlcm5hbWU=");'
    username
    Using
    Code:
    perl -MMIME::Base64=encode_base64 -e 'print encode_base64("username");'
    I can send my username "username" to my provider using "dXNlcm5hbWU="

    Using
    Code:
    perl -MDigest::MD5=md5_base64 -e 'print md5_base64("username");'
    I can send my username "username" to my provider using "FMSwa4JOxZMjk2JRf1OLKQ"

    So how it is decoded on isp side ?
    Thanks for helping. JCD
    __________

    server leap 15-- ASUS g75vw KDE leap 42.3 -- ASUS g750JZ KDE leap 42.3 -- acer aspire s13 win 10 home -- HP Omen win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

  9. #9
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,302
    Blog Entries
    15

    Default Re: perl - What version is in use ?

    Quote Originally Posted by jcdole View Post
    Using
    Code:
    perl -MMIME::Base64=encode_base64 -e 'print encode_base64("username");'
    I can send my username "username" to my provider using "dXNlcm5hbWU="

    Using
    Code:
    perl -MDigest::MD5=md5_base64 -e 'print md5_base64("username");'
    I can send my username "username" to my provider using "FMSwa4JOxZMjk2JRf1OLKQ"

    So how it is decoded on isp side ?
    Hi
    You can't decrypt, it's a digest (not a cypher) and only one way. Other end I would surmise hash it further with a key.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  10. #10
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    1,015

    Default Re: perl - What version is in use ?

    Quote Originally Posted by malcolmlewis View Post
    Hi
    You can't decrypt, it's a digest (not a cypher) and only one way. Other end I would surmise hash it further with a key.
    Sorry, but English is not my mother language. I don't understand what you try to explain.

    My question is rather :
    If I use "dXNlcm5hbWU=" ( perl -MMIME ) or "FMSwa4JOxZMjk2JRf1OLKQ" ( perl -MDigest ) in an encoded username/password mailx sequence with my ISP, is it equivalent.
    In other words, when my Internet service provider will check that I am who I claim to be, will they succeed with either encoded methods?

    Any comment is welcome.
    Thanks for helping. JCD
    __________

    server leap 15-- ASUS g75vw KDE leap 42.3 -- ASUS g750JZ KDE leap 42.3 -- acer aspire s13 win 10 home -- HP Omen win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •