<div dir="ltr">bcrypt is better than salting, if for no other reason because it's slower, and you can increase the work factor. scrypt seems to be better than bcrypt because you can increase the memory and the CPU cycles needed to generate the password for storage, however, it's less tested than bcrypt. You can find more info at <a href="http://en.wikipedia.org/wiki/Scrypt">http://en.wikipedia.org/wiki/Scrypt</a> and <a href="http://en.wikipedia.org/wiki/Bcrypt">http://en.wikipedia.org/wiki/Bcrypt</a>. It may be worth noting that bcrypt is available out of the box with Spring Security (and probably Shiro).</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 7, 2013 at 8:48 AM, Shane Bryzak <span dir="ltr"><<a href="mailto:sbryzak@redhat.com" target="_blank">sbryzak@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The credential handler SPI is totally pluggable, so while we provide a<br>
PlainTextPassword on the validate() or update() side, it's up to the<br>
credential handler how the password is represented in the backend<br>
identity store. I'm absolutely open to providing additional<br>
implementations if they're more secure than a hash. (To answer your<br>
question though, no we're not using the same salt).<br>
<div><div class="h5"><br>
On 08/01/13 01:33, Jason Porter wrote:<br>
> I haven't looked at the code yet, so forgive me if this is ignorance on my part. Are we using the same salt for every password? I think it might actually be a good idea to remove hashed passwords as an option and instead offer things more secure such as bcrypt or scrypt. One of those at least, imo, should be default. Hashed passwords, even with a salt are really not that secure and I'm not talking about rainbow table attacks, just plain brute force attacks with small box lots of GPU power and some coda code are quickly become the norm for brute forcing passwords.<br>
><br>
> This also brings up a good point with what are our recommendations and defaults? Encryption, hashing, account locks?<br>
><br>
> Sent from my iPhone<br>
><br>
> On Jan 7, 2013, at 8:27, Pedro Igor Silva <<a href="mailto:psilva@redhat.com">psilva@redhat.com</a>> wrote:<br>
><br>
>> +1<br>
>><br>
>> ----- Original Message -----<br>
>> From: "Bruno Oliveira" <<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>><br>
>> To: "Anil Saldhana" <<a href="mailto:Anil.Saldhana@redhat.com">Anil.Saldhana@redhat.com</a>><br>
>> Cc: <a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a><br>
>> Sent: Monday, January 7, 2013 12:58:01 PM<br>
>> Subject: Re: [security-dev] SHA salted passwords<br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> "The measure of a man is what he does with power" - Plato<br>
>> -<br>
>> @abstractj<br>
>> -<br>
>> Volenti Nihil Difficile<br>
>><br>
>><br>
>><br>
>> On Monday, January 7, 2013 at 12:18 PM, Anil Saldhana wrote:<br>
>><br>
>>> Having a PlainTextPassword and EncodedPassword separation at the class level is good. It clearly tells the user/developer what type of password is being stored. But if he chooses PTP, should we do the default salting/hashing in the background? The EncodedPassword can allow configuration of salting/hashing mechanisms.<br>
>>><br>
>>> We should not at any cost save plain text passwords in the tables.<br>
>> +1 and maybe for a while we could refactor PlainTextPassword to EncodedPassword and avoid some misunderstanding.<br>
>><br>
>> Makes sense?<br>
>>> Wdyt?<br>
>>><br>
>>><br>
>>> On 01/07/2013 08:14 AM, Pedro Igor Silva wrote:<br>
</div></div>>>>> Yeah, the class name is not good and leads to confusion. Today you do not need any extra code to get encoded passwords. The code you pointed out is already doing that: <a href="https://github.com/picketlink/TODO/blob/master/server/src/main/java/org/aerogear/todo/server/security/register/RegistrationEndpoint.java#L85" target="_blank">https://github.com/picketlink/TODO/blob/master/server/src/main/java/org/aerogear/todo/server/security/register/RegistrationEndpoint.java#L85</a> Behind the scenes it is using SHA-512 and a SecureRandom-1024 salt. Unfortunately, you can not change such configuration for now. Regards. Pedro Igor ----- Original Message ----- From: "Bruno Oliveira" <<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>> (mailto:<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>) To: "Pedro Igor Silva" <<a href="mailto:psilva@redhat.com">psilva@redhat.com</a>> (mailto:<a href="mailto:psilva@redhat.com">psilva@redhat.com</a>) Cc: <a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a> (mailto:<a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a>) Sent: Monday, January 7, 2013 11:49:08 AM Subject: Re: [security-dev] SHA salted passwords Hi Pedro, maybe the class name led me to some confusion and I missed the real concept here. So, the PlainTextPassword can be used to store encoded password which algorithm will be used behin!<br>
<div class="im"> d!<br>
>> the scen<br>
>> es? Which extra code is necessary to have encoded passwords on PicketLink? Could you please provide some example? +1 on EncodedPassword class.<br>
>>>> -- "The measure of a man is what he does with power" - Plato - @abstractj - Volenti Nihil Difficile On Monday, January 7, 2013 at 10:20 AM, Pedro Igor Silva wrote:<br>
>>>><br>
>>>>>> Actually, passwords are not stored in plain text by default. The PlainTextPassword is used to store both encoded and plain text passwords. > > Maybe we can change the API to better indicate whether you want to use encoded passwords or not. Something like this: > > Encoded : this.identityManager.updateCredential(user, new EncodedPassword(request.getPassword())); > > Plain Text: this.identityManager.updateCredential(user, new PlainTextPassword(request.getPassword())); > > Where for the EncodedPassword type you can specify the different configurations for the encoding such as supported algorithms, salt, etc. > > ----- Original Message ----- > From: "Bruno Oliveira" <<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a> (mailto:<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>)> (mailto:<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>%28mailto:<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>%29) > To: <a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a> (mailto:<a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a>) (mailto:<a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a>) > Sent: Monday, January 7, 2013 7:49:58 AM > Subject: [security-dev] SHA salted passwor!<br>
>> ds > > Go<br>
</div>>> od morning everyone. > > I'm planning to upgrade AeroGear to PicketLink, looking at the examples looks like the passwords will be stored in plain text > (<a href="https://github.com/picketlink/TODO/blob/master/server/src/main/java/org/aerogear/todo/server/security/register/RegistrationEndpoint.java#L85" target="_blank">https://github.com/picketlink/TODO/blob/master/server/src/main/java/org/aerogear/todo/server/security/register/RegistrationEndpoint.java#L85</a>). > > I was just wondering if ShaSaltedPasswordHash (<a href="https://github.com/picketlink/picketlink/blob/master/idm/impl/src/main/java/org/picketlink/idm/password/internal/SHASaltedPasswordHash.java#L13" target="_blank">https://github.com/picketlink/picketlink/blob/master/idm/impl/src/main/java/org/picketlink/idm/password/internal/SHASaltedPasswordHash.java#L13</a>) > could replace PlainTextPassword in this example, because I don't want to provide examples to our users with passwords stored in plain text. > > Is it possible? > > > -- > "The measure of a man is what he does with power" - Plato > - > @abstractj > - > Volenti Nihil Difficile > > > > _______________________________________________ > security-dev mailing list > <a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a> (mailto:<a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a>) (mailto:<a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a>) > <a href="https://lists.jboss.or" target="_blank">https://lists.jboss.or</a>!<br>
g!<br>
<div class="HOEnZb"><div class="h5">> /m!<br>
>> ailman/li<br>
>> stinfo/security-dev<br>
>>>> _______________________________________________ security-dev mailing list <a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a> (mailto:<a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a>) <a href="https://lists.jboss.org/mailman/listinfo/security-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/security-dev</a><br>
>>><br>
>>> _______________________________________________<br>
>>> security-dev mailing list<br>
>>> <a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a> (mailto:<a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a>)<br>
>>> <a href="https://lists.jboss.org/mailman/listinfo/security-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/security-dev</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> security-dev mailing list<br>
>> <a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/security-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/security-dev</a><br>
>><br>
>> _______________________________________________<br>
>> security-dev mailing list<br>
>> <a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/security-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/security-dev</a><br>
> _______________________________________________<br>
> security-dev mailing list<br>
> <a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/security-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/security-dev</a><br>
<br>
<br>
<br>
_______________________________________________<br>
security-dev mailing list<br>
<a href="mailto:security-dev@lists.jboss.org">security-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/security-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/security-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jason Porter<br><a href="http://lightguard-jp.blogspot.com" target="_blank">http://lightguard-jp.blogspot.com</a><br><a href="http://twitter.com/lightguardjp" target="_blank">http://twitter.com/lightguardjp</a><br>
<br>Software Engineer<br>Open Source Advocate<br><br>PGP key id: 926CCFF5<br>PGP key available at: <a href="http://keyserver.net" target="_blank">keyserver.net</a>, <a href="http://pgp.mit.edu" target="_blank">pgp.mit.edu</a>
</div>