Skip Menu |

This queue is for tickets about the Digest-MD4 CPAN distribution.

Report information
The Basics
Id: 80552
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Digest-MD4

People
Owner: MIKEM [...] cpan.org
Requestors: herwin [...] snt.utwente.nl
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: md4_base64 generates non-valid base64 output
Date: Thu, 01 Nov 2012 20:08:57 +0100
To: bug-Digest-MD4 [...] rt.cpan.org
From: Herwin Weststrate <herwin [...] snt.utwente.nl>
$ perl -MDigest::MD4 -E 'say Digest::MD4::md4_base64("")' | base64 -d | xxd base64: 0000000: 31d6 cfe0 d16a e931 b73c 59d7 e0c0 89c0 1....j.1.<Y..... invalid input The output of md4_base64 is alway 22 characters. A valid base64 strings needs a multiple of 4 characters, the "=" is used to fill the gaps. The method md4_base64 therefore should append "==" to the generated string.
Subject: Re: [rt.cpan.org #80552] md4_base64 generates non-valid base64 output
Date: Fri, 02 Nov 2012 06:42:27 +1000
To: bug-Digest-MD4 [...] rt.cpan.org
From: Mike McCauley <mikem [...] open.com.au>
Hello Herwin, thanks for your note. The documentaiton for md4_base64 days: =item md4_base64($data,...) Same as md4(), but will return the digest as a base64 encoded string. The length of the returned string will be 22 and it will only contain characters from this set: 'A'..'Z', 'a'..'z', '0'..'9', '+' and '/'. Note that the base64 encoded string returned is not padded to be a multiple of 4 bytes long. If you want interoperability with other base64 encoded md4 digests you might want to append the redundant string "==" to the result. -------------------- So the behaviour conforms to the documentation, and I dont intend to change it. Especially because the widely used Digest::MD5 (upon which MD4 was based) works exactly the same way. Cheers. On Thursday, November 01, 2012 03:09:09 PM Herwin Weststrate via RT wrote: Show quoted text
> Thu Nov 01 15:09:09 2012: Request 80552 was acted upon. > Transaction: Ticket created by herwin@snt.utwente.nl > Queue: Digest-MD4 > Subject: md4_base64 generates non-valid base64 output > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: herwin@snt.utwente.nl > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80552 > > > > $ perl -MDigest::MD4 -E 'say Digest::MD4::md4_base64("")' | base64 -d | xxd > base64: 0000000: 31d6 cfe0 d16a e931 b73c 59d7 e0c0 89c0 1....j.1.<Y..... > invalid input > > The output of md4_base64 is alway 22 characters. A valid base64 strings > needs a multiple of 4 characters, the "=" is used to fill the gaps. The > method md4_base64 therefore should append "==" to the generated string.
-- Mike McCauley mikem@open.com.au Open System Consultants Pty. Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.open.com.au Phone +61 7 5598-7474 Fax +61 7 5598-7070 Radiator: the most portable, flexible and configurable RADIUS server anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS, TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP, DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, NetWare etc.