You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <ga...@gmail.com> on 2012/08/30 17:01:20 UTC

[codec] MD5 impls

All,

Do we want both the MD5 in org.apache.commons.codec.digest.Md5Crypt and the
one accessed through org.apache.commons.codec.digest.DigestUtils?

Thouhgts?

Thank you,
Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [codec] MD5 impls

Posted by Christian Hammers <ch...@lathspell.de>.
Am Thu, 30 Aug 2012 19:58:54 +0200
schrieb Thomas Neidhart <th...@gmail.com>:

> On 08/30/2012 06:31 PM, Gary Gregory wrote:
> > On Thu, Aug 30, 2012 at 11:53 AM, sebb <se...@gmail.com> wrote:
> > 
> >> On 30 August 2012 16:51, Gary Gregory <ga...@gmail.com>
> >> wrote:
> >>> On Thu, Aug 30, 2012 at 11:41 AM, sebb <se...@gmail.com> wrote:
> >>>
> >>>> On 30 August 2012 16:01, Gary Gregory <ga...@gmail.com>
> >>>> wrote:
> >>>>> All,
> >>>>>
> >>>>> Do we want both the MD5 in
> >>>>> org.apache.commons.codec.digest.Md5Crypt
> >> and
> >>>> the
> >>>>> one accessed through
> >>>>> org.apache.commons.codec.digest.DigestUtils?
> >>>>>
> >>>>> Thouhgts?
> >>>>
> >>>> Are they the same implementation?
> >>>>
> >>>
> >>> Well, no, org.apache.commons.codec.digest.Md5Crypt is new in
> >>> trunk, it
> >> has
> >>> not been in a release yet.
> >>
> >> So why has it been added if there was already an implementation?
> >>
> > 
> > 'twas an oversight.
> 
> it is not the same.
> 
> MD5Crypt uses the MD5 MessageDigest algorithm to produce a crypt
> variant based on it.
> 
> We could replace the call in MD5Crypt
> 
>    MessageDigest ctx = MessageDigest.getInstance(MD5_ALGORITHM);
> 
> with
> 
>    MessageDigest ctx = DigestUtils.getMd5Digest();
> 
> but then we would have to update the exception to be thrown
> (NoSuchAlgorithmException vs. RuntimeException)

Same goes for calls to SHA-256 and SHA-512 instances.
But I actually like getting rid of those checked exceptions that
will usually never occur as well as getting rid of the hardcoded
"SHA-512" algorithm name so I switch to DigestUtils.
Patches coming this weekend!

bye,

-christian-
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [codec] MD5 impls

Posted by Thomas Neidhart <th...@gmail.com>.
On 08/30/2012 06:31 PM, Gary Gregory wrote:
> On Thu, Aug 30, 2012 at 11:53 AM, sebb <se...@gmail.com> wrote:
> 
>> On 30 August 2012 16:51, Gary Gregory <ga...@gmail.com> wrote:
>>> On Thu, Aug 30, 2012 at 11:41 AM, sebb <se...@gmail.com> wrote:
>>>
>>>> On 30 August 2012 16:01, Gary Gregory <ga...@gmail.com> wrote:
>>>>> All,
>>>>>
>>>>> Do we want both the MD5 in org.apache.commons.codec.digest.Md5Crypt
>> and
>>>> the
>>>>> one accessed through org.apache.commons.codec.digest.DigestUtils?
>>>>>
>>>>> Thouhgts?
>>>>
>>>> Are they the same implementation?
>>>>
>>>
>>> Well, no, org.apache.commons.codec.digest.Md5Crypt is new in trunk, it
>> has
>>> not been in a release yet.
>>
>> So why has it been added if there was already an implementation?
>>
> 
> 'twas an oversight.

it is not the same.

MD5Crypt uses the MD5 MessageDigest algorithm to produce a crypt variant
based on it.

We could replace the call in MD5Crypt

   MessageDigest ctx = MessageDigest.getInstance(MD5_ALGORITHM);

with

   MessageDigest ctx = DigestUtils.getMd5Digest();

but then we would have to update the exception to be thrown
(NoSuchAlgorithmException vs. RuntimeException)

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [codec] MD5 impls

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Aug 30, 2012 at 11:53 AM, sebb <se...@gmail.com> wrote:

> On 30 August 2012 16:51, Gary Gregory <ga...@gmail.com> wrote:
> > On Thu, Aug 30, 2012 at 11:41 AM, sebb <se...@gmail.com> wrote:
> >
> >> On 30 August 2012 16:01, Gary Gregory <ga...@gmail.com> wrote:
> >> > All,
> >> >
> >> > Do we want both the MD5 in org.apache.commons.codec.digest.Md5Crypt
> and
> >> the
> >> > one accessed through org.apache.commons.codec.digest.DigestUtils?
> >> >
> >> > Thouhgts?
> >>
> >> Are they the same implementation?
> >>
> >
> > Well, no, org.apache.commons.codec.digest.Md5Crypt is new in trunk, it
> has
> > not been in a release yet.
>
> So why has it been added if there was already an implementation?
>

'twas an oversight.

Gary


>
> > Gary
> >
> >
> >> Dropping one would break compatibility, but one could potentially be
> >> deprecated, and in the meantime invoke the other.
> >>
> >> > Thank you,
> >> > Gary
> >> >
> >> > --
> >> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> >> > JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> >> > Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> >> > Blog: http://garygregory.wordpress.com
> >> > Home: http://garygregory.com/
> >> > Tweet! http://twitter.com/GaryGregory
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: dev-help@commons.apache.org
> >>
> >>
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> > Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [codec] MD5 impls

Posted by sebb <se...@gmail.com>.
On 30 August 2012 16:51, Gary Gregory <ga...@gmail.com> wrote:
> On Thu, Aug 30, 2012 at 11:41 AM, sebb <se...@gmail.com> wrote:
>
>> On 30 August 2012 16:01, Gary Gregory <ga...@gmail.com> wrote:
>> > All,
>> >
>> > Do we want both the MD5 in org.apache.commons.codec.digest.Md5Crypt and
>> the
>> > one accessed through org.apache.commons.codec.digest.DigestUtils?
>> >
>> > Thouhgts?
>>
>> Are they the same implementation?
>>
>
> Well, no, org.apache.commons.codec.digest.Md5Crypt is new in trunk, it has
> not been in a release yet.

So why has it been added if there was already an implementation?

> Gary
>
>
>> Dropping one would break compatibility, but one could potentially be
>> deprecated, and in the meantime invoke the other.
>>
>> > Thank you,
>> > Gary
>> >
>> > --
>> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> > JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
>> > Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
>> > Blog: http://garygregory.wordpress.com
>> > Home: http://garygregory.com/
>> > Tweet! http://twitter.com/GaryGregory
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [codec] MD5 impls

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Aug 30, 2012 at 11:41 AM, sebb <se...@gmail.com> wrote:

> On 30 August 2012 16:01, Gary Gregory <ga...@gmail.com> wrote:
> > All,
> >
> > Do we want both the MD5 in org.apache.commons.codec.digest.Md5Crypt and
> the
> > one accessed through org.apache.commons.codec.digest.DigestUtils?
> >
> > Thouhgts?
>
> Are they the same implementation?
>

Well, no, org.apache.commons.codec.digest.Md5Crypt is new in trunk, it has
not been in a release yet.

Gary


> Dropping one would break compatibility, but one could potentially be
> deprecated, and in the meantime invoke the other.
>
> > Thank you,
> > Gary
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> > Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [codec] MD5 impls

Posted by sebb <se...@gmail.com>.
On 30 August 2012 16:01, Gary Gregory <ga...@gmail.com> wrote:
> All,
>
> Do we want both the MD5 in org.apache.commons.codec.digest.Md5Crypt and the
> one accessed through org.apache.commons.codec.digest.DigestUtils?
>
> Thouhgts?

Are they the same implementation?

Dropping one would break compatibility, but one could potentially be
deprecated, and in the meantime invoke the other.

> Thank you,
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org