<br><br><div class="gmail_quote">On Thu, Jul 26, 2012 at 11:43 AM,  <span dir="ltr">&lt;<a href="mailto:exarkun@twistedmatrix.com" target="_blank">exarkun@twistedmatrix.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 02:28 pm, <a href="mailto:spalax@gresille.org">spalax@gresille.org</a> wrote:<br>
&gt;         Hello<br>
&gt;         I have a problem with checkers in Twisted, which could be<br>
&gt;solved by<br>
&gt;adding a new feature. I think I can write the necessary code, but<br>
&gt;before<br>
&gt;doing so, I would like to hear you about it.<br>
&gt;<br>
&gt;# The problem<br>
&gt;<br>
&gt;         If I am right, the only way passwords can be hashed when using<br>
&gt;authentication with perspective brokers is using MD5 [1]. However,<br>
&gt;there<br>
&gt;are two flaws with it.<br>
&gt;<br>
&gt;* First, MD5 is no longer considered sure. It may be possible, from the<br>
&gt;hashed password, to find the original one.<br>
&gt;* Second, in the current implementation of Twisted, no salt is used to<br>
&gt;hash the password. A salt is considered good practise : it is harder to<br>
&gt;find the password from the hashed form, and two identical passwords<br>
&gt;have<br>
&gt;different hashed form, which prevent someone looking at the hashed<br>
&gt;passwords to see if two users have the same password.<br>
<br>
</div>The second point is incorrect.  The hash is salted.  See the `respond`<br>
method in twisted/spread/pb.py.<br>
<div class="im">&gt;# A solution<br>
&gt;<br>
&gt;         I tried to implement the solution proposed in [1], and I think<br>
&gt;I can<br>
&gt;manage to do it. However, this seems to be a not-so-smart hack, which<br>
&gt;is<br>
&gt;not guaranteed to work in future releases of Twisted. That is why I am<br>
&gt;proposing a patch.<br>
&gt;<br>
&gt;         The patch would introduce some arguments to class<br>
&gt;PBServerFactory [2]<br>
&gt;to use (or not) a salt, and a different hash function. I am not settled<br>
&gt;down yet about the new signature of this class, but what is sure is<br>
&gt;that<br>
&gt;the default must be the actual behaviour, not to break programs already<br>
&gt;using Twisted. Then, I hesitate between<br>
<br>
</div>A good approach would be to parameterize the supported authentication<br>
mechanisms in an extensible way, rather than just hard coding one or two<br>
new (probably better) options.<br>
<br>
In other words, a SASL implementation for PB would be the best way to<br>
go.<br>
<br>
The existing API and behavior should indeed be preserved as-is for<br>
backwards compatibility.  The new authentication features should be<br>
exposed under a new API - either as new optional arguments accepted by<br>
PBServerFactory (and perhaps PBClientFactory) and new login methods<br>
(again, probably on those two classes).<br>
<span class="HOEnZb"><font color="#888888"><br>
Jean-Paul<br>
</font></span><div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>It would probably also help if someone finished the &quot;Generic SASL implementation&quot; ticket.</div><div><br></div><div>
Lessee, who was working on that last?</div><div><br></div><div>Crap. It was me. </div><div><br></div><div>Sorry about that.</div><div><br></div><div>Kevin Horn</div></div>