userPassword, base64 and hashing

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

 



Aha!, such a subtle difference, thank you so much!

Cheers,

Mike

On Dec 7, 2007 6:08 AM, Plummer, Christina E.
<Christina.Plummer at energyeast.com> wrote:
> The first page is giving hex-encoded output of the SHA1 digest, and then
> the second page gave you a base64-encoded output of the hex.  Directory
> Server never bothers to convert it to hex.
>
> A slightly wordy Perl one-liner illuminates this:
>
> perl -e 'use MIME::Base64; use Digest::SHA1  qw(sha1 sha1_hex);
> $string="password"; print "Base64:\n\t", encode_base64( sha1($string) );
> print "Hex:\n\t",sha1_hex($string),"\n"; print "Base64 of Hex:\n\t",
> encode_base64( sha1_hex($string) ); '
> Base64:
>         W6ph5Mm5Pz8GgiULbPgzG37mj9g=
> Hex:
>         5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
> Base64 of Hex:
>         NWJhYTYxZTRjOWI5M2YzZjA2ODIyNTBiNmNmODMzMWI3ZWU2OGZkOA==
>
> Hope that helps.




[Index of Archives]     [Fedora User Discussion]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora News]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora QA]     [Fedora Triage]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Yosemite Photos]     [Linux Apps]     [Maemo Users]     [Gnome Users]     [KDE Users]     [Fedora Tools]     [Fedora Art]     [Fedora Docs]     [Maemo Users]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Fedora ARM]

  Powered by Linux