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

Re: [Fedora-directory-users] userPassword, base64 and hashing



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

Cheers,

Mike

On Dec 7, 2007 6:08 AM, Plummer, Christina E.
<Christina Plummer 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.


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