<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pycrypto.git/lib/Crypto, branch master</title>
<subtitle>github.com: dlitz/pycrypto.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/'/>
<entry>
<title>Increase attempts for recovering RSA (p,q) from (n,e,d)</title>
<updated>2014-06-23T07:12:24+00:00</updated>
<author>
<name>Wouter Bolsterlee</name>
<email>uws@xs4all.nl</email>
</author>
<published>2014-06-20T20:07:46+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=7acba5f3a6ff10f1424c309d0d34d2b713233019'/>
<id>7acba5f3a6ff10f1424c309d0d34d2b713233019</id>
<content type='text'>
Bump the maximum number of iterations to recover (p,q) given (n,e,d) to
increase the chance that the algorithm succeeds. The algorithm used is a
probabilistic one with a 1/2 chance of finding the right value in each
iteration, so it's likely that only a few iterations are needed.

However, in some extreme cases this may still fail. Bumping the maximum
number allow the algorithm to correctly find the right values for these
cases. This changes bumps the number of iterations from 50 to 500 (the
value 'a' is increased by 2 in each step), and hence reduces the chance
of failure from 2**-50 to 2**-500.

Note that this change does *not* result in a performance degradation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bump the maximum number of iterations to recover (p,q) given (n,e,d) to
increase the chance that the algorithm succeeds. The algorithm used is a
probabilistic one with a 1/2 chance of finding the right value in each
iteration, so it's likely that only a few iterations are needed.

However, in some extreme cases this may still fail. Bumping the maximum
number allow the algorithm to correctly find the right values for these
cases. This changes bumps the number of iterations from 50 to 500 (the
value 'a' is increased by 2 in each step), and hence reduces the chance
of failure from 2**-50 to 2**-500.

Note that this change does *not* result in a performance degradation.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make Cipher.galois module private</title>
<updated>2014-06-23T06:47:53+00:00</updated>
<author>
<name>Legrandin</name>
<email>helderijs@gmail.com</email>
</author>
<published>2014-04-26T07:10:19+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=9e2b6af8c34efba80d141490b48b82a3c2185ae5'/>
<id>9e2b6af8c34efba80d141490b48b82a3c2185ae5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Make GHASH more robust against timing attacks.</title>
<updated>2014-06-23T06:38:31+00:00</updated>
<author>
<name>Legrandin</name>
<email>helderijs@gmail.com</email>
</author>
<published>2014-03-23T17:46:55+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=947b554d85012cf35185ded38ef3484de010d2cf'/>
<id>947b554d85012cf35185ded38ef3484de010d2cf</id>
<content type='text'>
In order to speed up as much as possible the GHASH,
the current implementation expands the 16 byte hash key
(H) into a table of 64 KBytes. However, that is sensitive
to cache-based timing attacks.

If we assume that access to data inside the same cache line
is constant-time (likely), fitting a table item into a cache
line may help against the attacks.

This patch reduce the pre-computed table from 64K to 4K
and aligns every item to a 32 byte boundary (since most modern
CPUs have cache line of that size or larger).

This patch will reduce the overall performance.

This patch also reverts commit 965871a727 ("GCM mode:
Optimize key setup for GCM mode") since I actually
got conflicting benchmark results.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to speed up as much as possible the GHASH,
the current implementation expands the 16 byte hash key
(H) into a table of 64 KBytes. However, that is sensitive
to cache-based timing attacks.

If we assume that access to data inside the same cache line
is constant-time (likely), fitting a table item into a cache
line may help against the attacks.

This patch reduce the pre-computed table from 64K to 4K
and aligns every item to a 32 byte boundary (since most modern
CPUs have cache line of that size or larger).

This patch will reduce the overall performance.

This patch also reverts commit 965871a727 ("GCM mode:
Optimize key setup for GCM mode") since I actually
got conflicting benchmark results.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add side-channel countermeasures to DSA.</title>
<updated>2014-06-23T06:30:26+00:00</updated>
<author>
<name>Legrandin</name>
<email>helderijs@gmail.com</email>
</author>
<published>2013-12-27T22:44:38+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=0782d68840d0ebf850516e606e398b8a5396eb64'/>
<id>0782d68840d0ebf850516e606e398b8a5396eb64</id>
<content type='text'>
This patch strenghten the DSA signing code against
side-channel attacks.

The DSA signing formulae:

r = (g^{k} mod p) mod q
s = k^{-1} * (H(m) + r*x) mod q

becomes:

b = random in [1..q)
r = (g^{k} mod p) mod q
s = (b * k)^{-1} * (b*H(m) + r*(b*x)) mod q

In this way we avoid that the secret (x) gets multiplied
by a random factor (r) which is immediately disclosed
to an attacker (which we assume can both collect (r) and
also monitor the side-channel produced by the multiplication).

See also attack DSA_2 in:

"Minimum Requirements for Evaluating Side-Channel Attack Resistance
of RSA, DSA and Diffie-Hellman Key Exchange Implementations", BSI
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch strenghten the DSA signing code against
side-channel attacks.

The DSA signing formulae:

r = (g^{k} mod p) mod q
s = k^{-1} * (H(m) + r*x) mod q

becomes:

b = random in [1..q)
r = (g^{k} mod p) mod q
s = (b * k)^{-1} * (b*H(m) + r*(b*x)) mod q

In this way we avoid that the secret (x) gets multiplied
by a random factor (r) which is immediately disclosed
to an attacker (which we assume can both collect (r) and
also monitor the side-channel produced by the multiplication).

See also attack DSA_2 in:

"Minimum Requirements for Evaluating Side-Channel Attack Resistance
of RSA, DSA and Diffie-Hellman Key Exchange Implementations", BSI
</pre>
</div>
</content>
</entry>
<entry>
<title>Extended fix for the RSA boundary check</title>
<updated>2014-06-23T04:28:37+00:00</updated>
<author>
<name>Legrandin</name>
<email>helderijs@gmail.com</email>
</author>
<published>2014-05-07T10:20:46+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=f49fd0e1b57071e52200806d095679753fe36e17'/>
<id>f49fd0e1b57071e52200806d095679753fe36e17</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove a few custom exception types.</title>
<updated>2014-06-23T03:42:00+00:00</updated>
<author>
<name>Legrandin</name>
<email>helderijs@gmail.com</email>
</author>
<published>2014-03-04T21:04:34+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=629c26c21857f205b08211d7b1333eb5580c525d'/>
<id>629c26c21857f205b08211d7b1333eb5580c525d</id>
<content type='text'>
The following custom exceptions are replaced with ValueError:
* Crypto.Util.PaddingError
* Crypto.PublicKey.KeyFormatError

The custom Crypto.Util.asn1.NoDerElementError is now private to the
module.

Some white spaces have been removed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following custom exceptions are replaced with ValueError:
* Crypto.Util.PaddingError
* Crypto.PublicKey.KeyFormatError

The custom Crypto.Util.asn1.NoDerElementError is now private to the
module.

Some white spaces have been removed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix tobytes() broken by previous commit.</title>
<updated>2014-06-23T03:17:45+00:00</updated>
<author>
<name>Dwayne Litzenberger</name>
<email>dlitz@dlitz.net</email>
</author>
<published>2014-06-23T03:17:45+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=f070adf984c6bb3ef72a3bf3d05648ea304eaa61'/>
<id>f070adf984c6bb3ef72a3bf3d05648ea304eaa61</id>
<content type='text'>
Python 2.1 str objects don't have a .decode() method.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Python 2.1 str objects don't have a .decode() method.
</pre>
</div>
</content>
</entry>
<entry>
<title>Get rid of catch-all exceptions. LP#1178485.</title>
<updated>2014-06-23T03:16:05+00:00</updated>
<author>
<name>Richard Mitchell</name>
<email>richard.j.mitchell@gmail.com</email>
</author>
<published>2014-04-29T13:55:26+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=9e171b794f102f5745076051202997df9eac254a'/>
<id>9e171b794f102f5745076051202997df9eac254a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix tests when running under "python -OO" (PYTHONOPTIMIZE set to 1 or 2)</title>
<updated>2014-06-22T11:07:24+00:00</updated>
<author>
<name>Dwayne Litzenberger</name>
<email>dlitz@dlitz.net</email>
</author>
<published>2014-06-22T10:32:46+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=54f2bc5b81124bfff8fa7f1b7cd6287a1fee1152'/>
<id>54f2bc5b81124bfff8fa7f1b7cd6287a1fee1152</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix BytesWarning when running with "python3 -bb"</title>
<updated>2014-06-22T11:07:24+00:00</updated>
<author>
<name>Dwayne Litzenberger</name>
<email>dlitz@dlitz.net</email>
</author>
<published>2014-06-22T10:06:01+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/python-packages/pycrypto.git/commit/?id=0ac94701bb52fef566f96ce43eb8db6befee9b60'/>
<id>0ac94701bb52fef566f96ce43eb8db6befee9b60</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
