<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Bitbashing</title><link>https://randombit.net/bitbashing/</link><description>Blathering</description><atom:link href="https://randombit.net/bitbashing/rss.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2020 &lt;a href="mailto:jack@randombit.net"&gt;Jack Lloyd&lt;/a&gt; </copyright><lastBuildDate>Wed, 04 Mar 2020 15:32:56 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Const-time Modular Inversion Using CRT</title><link>https://randombit.net/bitbashing/posts/modular_inversion_using_crt.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;Modular inversion is an important component in many cryptographic computations,
notably in number-theoretic public key cryptosystems like RSA and ECDSA.  In
such uses, we must both perform the computation as quickly as possible and also
in const-time, that is without any software-observable side channels which leak
information about the inputs or output. Otherwise it is possible to attack
computations such as RSA key generation or ECDSA signature generation, and
recover the secret key.&lt;/p&gt;
&lt;p&gt;This is a bad thing.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/modular_inversion_using_crt.html"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><category>math</category><guid>https://randombit.net/bitbashing/posts/modular_inversion_using_crt.html</guid><pubDate>Wed, 04 Mar 2020 05:00:00 GMT</pubDate></item><item><title>Simple and hardware friendly RSA threshold signatures</title><link>https://randombit.net/bitbashing/posts/simple_rsa_threshold_sigs.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;A &lt;span class="math"&gt;\((n,t)\)&lt;/span&gt; threshold signature schemes allow splitting a key into
&lt;span class="math"&gt;\(n\)&lt;/span&gt; pieces, in such a way that at least &lt;span class="math"&gt;\(t &amp;lt; n\)&lt;/span&gt;
participants must jointly use their key shards in order to generate a
valid signature.&lt;/p&gt;
&lt;p&gt;Many techniques for RSA threshold signatures have been developed. Currently
published techniques require either a trusted dealer, or use of a distributed
key generation algorithm. In addition, the signers must perform a non-standard
RSA signature; that is, signing a message with a private exponent which is not
equal to &lt;span class="math"&gt;\(e^{-1} \bmod n\)&lt;/span&gt;. Both requirements prevent using standard hardware
such as HSMs or smartcards to protect the key shards.&lt;/p&gt;
&lt;p&gt;I discovered a technique for &lt;span class="math"&gt;\(n\)&lt;/span&gt;-of-&lt;span class="math"&gt;\(n\)&lt;/span&gt; RSA signatures where both
keys and signatures can be computed using standard cryptographic hardware.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/simple_rsa_threshold_sigs.html"&gt;Read more…&lt;/a&gt; (4 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><guid>https://randombit.net/bitbashing/posts/simple_rsa_threshold_sigs.html</guid><pubDate>Sun, 04 Aug 2019 04:00:00 GMT</pubDate></item><item><title>How Not To Do BLS Signatures</title><link>https://randombit.net/bitbashing/posts/bls_hashing_fail.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;The BLS signature scheme has several interesting properties, namely
that the signatures are very short compared to any other known scheme,
and it affords a simple implementation of threshold signatures and
signature aggregation. For these reasons it has been of some interest
especially in cryptocurrencies which can make good use of these properties.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/bls_hashing_fail.html"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><guid>https://randombit.net/bitbashing/posts/bls_hashing_fail.html</guid><pubDate>Wed, 24 Jul 2019 04:00:00 GMT</pubDate></item><item><title>Bit manipulations using BMI2</title><link>https://randombit.net/bitbashing/posts/haswell_bit_permutations.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;Intel's Haswell design (expected in 2013) will include a new
instruction set called BMI2 with various fun bit manipulation
instructions. Particularly of note are the &lt;tt class="docutils literal"&gt;pext&lt;/tt&gt; and &lt;tt class="docutils literal"&gt;pdep&lt;/tt&gt;
instructions which are essentially bit-level gather/scatter
operations. Combining two &lt;tt class="docutils literal"&gt;pext&lt;/tt&gt; operations results in the GRP
instruction described in &lt;a class="reference external" href="http://palms.ee.princeton.edu/PALMSopen/lee01efficient.pdf"&gt;Efficient Permutation Instructions for Fast
Software Cryptography&lt;/a&gt;, where
the authors show how to implement bit level permutations using a
variety of instructions. Perhaps not coincidentally at least one of
the authors now works at Intel.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/haswell_bit_permutations.html"&gt;Read more…&lt;/a&gt; (4 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><guid>https://randombit.net/bitbashing/posts/haswell_bit_permutations.html</guid><pubDate>Sat, 02 Jun 2012 04:00:00 GMT</pubDate></item><item><title>Using std::async for easy parallel computations</title><link>https://randombit.net/bitbashing/posts/cpp_async.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;C++0x, the next major revision of C++, includes a number of new
language and library facilities that I am greatly looking forward to,
including a standard thread interface. Initially the agenda for C++0x
had included facilities built on threads, such as a thread pool, but as
part of the so-called 'Kona compromise' (named after the location of
the committee meeting where the compromise was made) all but the most
basic facilities were deferred for a later revision.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/cpp_async.html"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><guid>https://randombit.net/bitbashing/posts/cpp_async.html</guid><pubDate>Tue, 24 Nov 2009 05:00:00 GMT</pubDate></item><item><title>Converting Line Endings in InnoSetup</title><link>https://randombit.net/bitbashing/posts/convert_line_endings_in_innosetup.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;I recently packaged &lt;a class="reference external" href="https://botan.randombit.net"&gt;botan&lt;/a&gt; using
&lt;a class="reference external" href="http://www.jrsoftware.org/isinfo.php"&gt;InnoSetup&lt;/a&gt;, an open source
installation creator. Overall I was pretty pleased with it - it seems
to do everything I need it to do without much of a hassle, and I'll
probably use it in the future if I need to package other programs or
tools for Windows.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/convert_line_endings_in_innosetup.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><guid>https://randombit.net/bitbashing/posts/convert_line_endings_in_innosetup.html</guid><pubDate>Mon, 23 Nov 2009 05:00:00 GMT</pubDate></item><item><title>The Case For Skein</title><link>https://randombit.net/bitbashing/posts/the_case_for_skein.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;After the initial set of attacks on MD5 and SHA-1, NIST organized a
series of conferences on hash function design. I was lucky enough to
be able to attend the first one, and had a great time. This was the
place where the suggestion of a competition in the style of the AES
process to replace SHA-1 and SHA-2 was first proposed (to wide
approval). This has resulted in over 60 submissions to the &lt;a class="reference external" href="http://ehash.iaik.tugraz.at/wiki/The_SHA-3_Zoo"&gt;SHA-3&lt;/a&gt; contest, of
which 14 have been brought into the second round.&lt;/p&gt;
&lt;p&gt;Of the second round contenders, I think Skein is the best choice
for becoming SHA-3, and want to explain why I think so.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/the_case_for_skein.html"&gt;Read more…&lt;/a&gt; (6 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><guid>https://randombit.net/bitbashing/posts/the_case_for_skein.html</guid><pubDate>Fri, 09 Oct 2009 04:00:00 GMT</pubDate></item><item><title>4x4 integer matrix transpose in SSE2</title><link>https://randombit.net/bitbashing/posts/integer_matrix_transpose_in_sse2.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;The Intel SSE2 intrinsics has a macro &lt;tt class="docutils literal"&gt;_MM_TRANSPOSE4_PS&lt;/tt&gt;
which performs a matrix transposition on a 4x4 array represented by
elements in 4 SSE registers. However, it doesn't work with integer
registers because Intel intrinsics make a distinction between integer
and floating point SSE registers. Theoretically one could cast and use
the floating point operations, but it seems quite plausible that this
will not round trip properly; for instance if one of your integer
values happens to have the same value as a 32-bit IEEE denormal.&lt;/p&gt;
&lt;p&gt;However it is easy to do with the punpckldq, punpckhdq, punpcklqdq,
and punpckhqdq instructions; code and diagrams ahoy.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/integer_matrix_transpose_in_sse2.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><category>simd</category><guid>https://randombit.net/bitbashing/posts/integer_matrix_transpose_in_sse2.html</guid><pubDate>Thu, 08 Oct 2009 04:00:00 GMT</pubDate></item><item><title>Speeding up Serpent: SIMD Edition</title><link>https://randombit.net/bitbashing/posts/serpent_in_simd.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;The &lt;a class="reference external" href="http://www.cl.cam.ac.uk/~rja14/serpent.html"&gt;Serpent&lt;/a&gt;
block cipher was one of the 5 finalists in the AES competition, and is
widely thought to be the most secure of them due to its conservative
design.  It was also considered the slowest candidate, which is one
major reason it did not win the AES contest. However, it turns out
that on modern machines one can use SIMD operations to implement
Serpent at speeds quite close to AES.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/serpent_in_simd.html"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><category>simd</category><guid>https://randombit.net/bitbashing/posts/serpent_in_simd.html</guid><pubDate>Wed, 09 Sep 2009 04:00:00 GMT</pubDate></item><item><title>Inverting Mersenne Twister's final transform</title><link>https://randombit.net/bitbashing/posts/inverting_mt19937_tempering.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;The Mersenne twister RNG 'tempers' its output using an invertible
transformation:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
unsigned int temper(unsigned int x)
   {
   x ^= (x &amp;gt;&amp;gt; 11);
   x ^= (x &amp;lt;&amp;lt; 7) &amp;amp; 0x9D2C5680;
   x ^= (x &amp;lt;&amp;lt; 15) &amp;amp; 0xEFC60000;
   x ^= (x &amp;gt;&amp;gt; 18);
   return x;
   }
&lt;/pre&gt;
&lt;p&gt;The inversion function is:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
unsigned int detemper(unsigned int x)
   {
   x ^= (x &amp;gt;&amp;gt; 18);
   x ^= (x &amp;lt;&amp;lt; 15) &amp;amp; 0xEFC60000;
   x ^= (x &amp;lt;&amp;lt; 7) &amp;amp; 0x1680;
   x ^= (x &amp;lt;&amp;lt; 7) &amp;amp; 0xC4000;
   x ^= (x &amp;lt;&amp;lt; 7) &amp;amp; 0xD200000;
   x ^= (x &amp;lt;&amp;lt; 7) &amp;amp; 0x90000000;
   x ^= (x &amp;gt;&amp;gt; 11) &amp;amp; 0xFFC00000;
   x ^= (x &amp;gt;&amp;gt; 11) &amp;amp; 0x3FF800;
   x ^= (x &amp;gt;&amp;gt; 11) &amp;amp; 0x7FF;

   return x;
   }
&lt;/pre&gt;
&lt;p&gt;This inversion has been confirmed correct with exhaustive search.&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><guid>https://randombit.net/bitbashing/posts/inverting_mt19937_tempering.html</guid><pubDate>Tue, 21 Jul 2009 04:00:00 GMT</pubDate></item><item><title>Optimizing Forward Error Correction Coding Using SIMD Instructions</title><link>https://randombit.net/bitbashing/posts/forward_error_correction_using_simd.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;Forward error correction (FEC) is a technique for handling lossy
storage devices or transmission channels. A FEC code takes &lt;em&gt;k&lt;/em&gt; blocks
of data and produces an additional &lt;em&gt;m&lt;/em&gt; blocks of encoding information,
such that any set of &lt;em&gt;k&lt;/em&gt; of the blocks (out of the &lt;em&gt;k+m&lt;/em&gt; total) is
sufficient to recover the original data. One can think of RAID5 as a
FEC with arbitrary &lt;em&gt;k&lt;/em&gt; and &lt;em&gt;m&lt;/em&gt; fixed at 1; most FEC algorithms allow
wide latitude for the values that can be sent, allowing the code to be
adjusted for the reliability expectations and needs of the particular
channel and application. For instance, the &lt;a class="reference external" href="http://allmydata.org/trac/tahoe"&gt;Tahoe&lt;/a&gt; distributed filesystem splits
stored files using &lt;em&gt;k&lt;/em&gt; of 3 and &lt;em&gt;m&lt;/em&gt; of 7, so as long as at least 30%
of the devices storing the file survive, the original file can be
recoved.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/forward_error_correction_using_simd.html"&gt;Read more…&lt;/a&gt; (9 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><category>simd</category><guid>https://randombit.net/bitbashing/posts/forward_error_correction_using_simd.html</guid><pubDate>Mon, 19 Jan 2009 05:00:00 GMT</pubDate></item><item><title>On Syllable's /dev/random</title><link>https://randombit.net/bitbashing/posts/syllable_dev_random.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;Inspired by the recent &lt;a class="reference external" href="http://security.freebsd.org/advisories/FreeBSD-SA-08:11.arc4random.asc"&gt;FreeBSDarc4random&lt;/a&gt;
vulnerability, I've been taking a look at the random number generators
used by various libraries and operating systems.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/syllable_dev_random.html"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><guid>https://randombit.net/bitbashing/posts/syllable_dev_random.html</guid><pubDate>Tue, 09 Dec 2008 05:00:00 GMT</pubDate></item><item><title>Serious Weakness in GNU Classpath/gcj PRNG; DSA keys are compromised</title><link>https://randombit.net/bitbashing/posts/gnu_classpath_prng_analysis.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;&lt;a class="reference external" href="http://www.gnu.org/software/classpath/"&gt;GNU Classpath&lt;/a&gt; is an open source implementation of the Java class
libraries used by &lt;a class="reference external" href="http://gcc.gnu.org/java/"&gt;gcj&lt;/a&gt;, the
GNU Compiler for Java. One component of the Java library is JCE, the
Java Cryptography Extensions (so called because originally it was not
bundled with the JVM due to United States export restrictions), which
provides the basic crypto features one would expect (ciphers, hashing,
signatures) for Java applications. I found a rather interesting bug
that compromised all RSA and DSA keys used with GNU classpath.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/gnu_classpath_prng_analysis.html"&gt;Read more…&lt;/a&gt; (4 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><guid>https://randombit.net/bitbashing/posts/gnu_classpath_prng_analysis.html</guid><pubDate>Sat, 06 Dec 2008 05:00:00 GMT</pubDate></item><item><title>The More Things Change...</title><link>https://randombit.net/bitbashing/posts/juce_rng_fail.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;blockquote&gt;
"Anyone who considers arithmetic methods of producing random digits
is, of course, in a state of sin." - John von Neumann, 1951&lt;/blockquote&gt;
&lt;p&gt;On an Ubuntu forum I caught a reference to a C++ library called &lt;a class="reference external" href="http://www.rawmaterialsoftware.com/juce/"&gt;JUCE&lt;/a&gt;, which is one of those
all-inclusive C++ libraries along the lines of &lt;a class="reference external" href="http://pocoproject.org"&gt;POCO&lt;/a&gt; or &lt;a class="reference external" href="http://www.gnu.org/software/commoncpp/"&gt;GNU Common C++&lt;/a&gt;. One thing I noticed was
that it includes a few cryptographic operations, including RSA key
generation, so I decided to take a peek at the latest release as of
this writing, 1.46.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/juce_rng_fail.html"&gt;Read more…&lt;/a&gt; (5 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><guid>https://randombit.net/bitbashing/posts/juce_rng_fail.html</guid><pubDate>Fri, 05 Dec 2008 05:00:00 GMT</pubDate></item><item><title>A Failure Case in a Linux Random Number Generator</title><link>https://randombit.net/bitbashing/posts/linux_random32_fail.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;The Linux kernel implements a random number generator called a
Tausworthe generator, in the file &lt;tt class="docutils literal"&gt;lib/kernel32.c&lt;/tt&gt;. The kernel uses
this generator for a variety of non-cryptographic purposes, such as
calculating network delays and random ports numbers, choosing a random
element to drop from full caches, and many other places where a
randomized algorithm is useful. While looking through this source, I
found some cases where it could fail quite dramatically.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/linux_random32_fail.html"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><guid>https://randombit.net/bitbashing/posts/linux_random32_fail.html</guid><pubDate>Tue, 01 Jul 2008 04:00:00 GMT</pubDate></item><item><title>Roman Proverbs Applicable to Software</title><link>https://randombit.net/bitbashing/posts/doc_proverb.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;p&gt;&lt;em&gt;Quod non est in actis, non est in mundo.&lt;/em&gt;
("What is not in the documents does not exist")&lt;/p&gt;</description><category>programming</category><guid>https://randombit.net/bitbashing/posts/doc_proverb.html</guid><pubDate>Mon, 30 Jun 2008 04:00:00 GMT</pubDate></item><item><title>Insurance, Evaluation, Risks</title><link>https://randombit.net/bitbashing/posts/insurance_and_evaluation.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;The bond insurers MBIA and Ambac are going bankrupt because they
wrote insurance for mortgage backed securities which are now failing at
rates far higher than they had estimated. This is a pretty common
problem with insurance; humans tend to be really bad at estimating or
pricing risk.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/insurance_and_evaluation.html"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>security</category><guid>https://randombit.net/bitbashing/posts/insurance_and_evaluation.html</guid><pubDate>Mon, 16 Jun 2008 04:00:00 GMT</pubDate></item><item><title>Racing in Java</title><link>https://randombit.net/bitbashing/posts/java_ttctou.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;Reading the documentation for Java's &lt;a class="reference external" href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html"&gt;File&lt;/a&gt;
object, I was astounded to find that the Java designers managed to
replicate one of the best known file system &lt;a class="reference external" href="http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/avoid-race.html"&gt;race conditions&lt;/a&gt;
for no good reason: the functions &lt;tt class="docutils literal"&gt;canRead&lt;/tt&gt; and &lt;tt class="docutils literal"&gt;canWrite&lt;/tt&gt; are
essentially the Java equivalents of the &lt;tt class="docutils literal"&gt;access&lt;/tt&gt; function, which is
so well known to be a security hole that the Linux man page actually
warns that:&lt;/p&gt;
&lt;blockquote&gt;
Using access() to check if a user is authorized to e.g. open a file
before actually doing so using open(2) creates a security hole,
because the user might exploit the short time interval between
checking and opening the file to manipulate it.&lt;/blockquote&gt;
&lt;p&gt;While OpenBSD provides the less ambiguous caveat that:&lt;/p&gt;
&lt;blockquote&gt;
access() is a potential security hole and should never be used.&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/java_ttctou.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>security</category><guid>https://randombit.net/bitbashing/posts/java_ttctou.html</guid><pubDate>Wed, 14 May 2008 04:00:00 GMT</pubDate></item><item><title>Adventures in Signal Handling</title><link>https://randombit.net/bitbashing/posts/f_notify.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;I was reading the man page for Linux &lt;tt class="docutils literal"&gt;fcntl(2)&lt;/tt&gt;, because
I've never used it and was curious what exactly it could do. For
a couple of hours this afternoon, I thought I had perhaps found
a security vulnerability in the design, this post is to trace
my logic and describe what I learned.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/f_notify.html"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><category>security</category><guid>https://randombit.net/bitbashing/posts/f_notify.html</guid><pubDate>Sun, 02 Mar 2008 05:00:00 GMT</pubDate></item><item><title>Search Based Filesystem</title><link>https://randombit.net/bitbashing/posts/search_filesystem.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;I was using a friend's OS X machine briefly, and at one point thought
that how the "Movies" folder worked was it acted as an index into the
actual filesystem, using some search technology or another to find all
of your movies and present them to you. Presenting search results as a
directory of files instead of a list (especially with movies, since
they are normally a single file that are more or less independent of
each other) seemed so obviously user-friendly that I figured that had
to be what Apple would do. (Apparently not: my friend said it's just a
plain old directory with actual files in it). But my misconception
planted the idea that this would be pretty useful!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/search_filesystem.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><guid>https://randombit.net/bitbashing/posts/search_filesystem.html</guid><pubDate>Sat, 13 Oct 2007 04:00:00 GMT</pubDate></item><item><title>Python Format String Annoyance</title><link>https://randombit.net/bitbashing/posts/python_format_strings.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;Python's format string operator is useful, but if you wish to provide
arguments to it you must do so all at once. This makes some situations
harder to deal with, including this one wherein I am annoyed at being
unable to compact some Python code manipulating a MySQL database.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/python_format_strings.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><guid>https://randombit.net/bitbashing/posts/python_format_strings.html</guid><pubDate>Mon, 09 Apr 2007 04:00:00 GMT</pubDate></item><item><title>Huffman Encoding of Phone Contacts</title><link>https://randombit.net/bitbashing/posts/contact_list_sorting.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;Every mobile phone I've ever used or heard of sorts their contact
lists in alphabetical order based on name.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/contact_list_sorting.html"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><guid>https://randombit.net/bitbashing/posts/contact_list_sorting.html</guid><pubDate>Sat, 10 Mar 2007 05:00:00 GMT</pubDate></item><item><title>Algorithmic Complexity Attacks on Allocators</title><link>https://randombit.net/bitbashing/posts/allocation.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;A few years back some researchers presented the concept of performing
denial of service through &lt;a class="reference external" href="http://www.cs.rice.edu/~scrosby/hash/"&gt;algorithmic complexity attacks&lt;/a&gt;, which essentially cause
pathological behavior in data structures like hash tables through
carefully chosen inputs.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/allocation.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>algorithms</category><category>security</category><guid>https://randombit.net/bitbashing/posts/allocation.html</guid><pubDate>Wed, 01 Nov 2006 05:00:00 GMT</pubDate></item><item><title>Finding Equivalences of Boolean Function</title><link>https://randombit.net/bitbashing/posts/booleans.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;A fairly common class of functions in crypto are functions mapping
{0,1}&lt;sup&gt;3&lt;/sup&gt; onto {0,1}. In particular, these show up a lot in hash
functions derived from MD4, including MD5, SHA-1, RIPEMD, and
SHA-512. These range in complexity from simple three-term expressions
like "(A xor B xor C)" to functions like "((A and B) or (C and (A or
B)))". One interesting and important difference between these two
functions becomes very important when you consider how to implement
these functions on an x86 (or x86-64) processor. The x86 uses
two-operand instructions, and has very few registers, so computing
something like "(A and B) xor (not(A) and C)", which requires two
temporaries (one to hold A and B, the other (not(A) and C)) might
require you to spill values to the stack. Often, that means a major
performance hit. Finding an alternate form for this function that only
requires fewer temporary registers could be a major benefit. Obviously
finding these equivalences could be done by hand, but having a
computer do it seemed both faster and more interesting.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/booleans.html"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>algorithms</category><category>programming</category><guid>https://randombit.net/bitbashing/posts/booleans.html</guid><pubDate>Wed, 30 Aug 2006 04:00:00 GMT</pubDate></item><item><title>Fun with assembly</title><link>https://randombit.net/bitbashing/posts/x86_asm_hashing.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;blockquote&gt;
&lt;dl class="docutils"&gt;
&lt;dt&gt;"If you can explain how you do something, then you're very very bad at it."&lt;/dt&gt;
&lt;dd&gt;-- John Hopfield&lt;/dd&gt;
&lt;/dl&gt;
&lt;/blockquote&gt;
&lt;p&gt;The &lt;a class="reference external" href="http://venge.net/monotone"&gt;Monotone&lt;/a&gt; folks have been doing some
profiling and performance work of late. One thing that came out of
that was the finding that Botan's SHA-1 implementation was causing a
bottleneck; because Monotone identifies everything via hashes, there
are times where it needs to hash many (many) megabytes of source data,
and the faster that happens, the better. Since low-level C++ wasn't
cutting it, I felt that it was time to try my hand at x86 assembly
again.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/x86_asm_hashing.html"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><category>programming</category><guid>https://randombit.net/bitbashing/posts/x86_asm_hashing.html</guid><pubDate>Sun, 13 Aug 2006 04:00:00 GMT</pubDate></item><item><title>Initial Impressions of C#</title><link>https://randombit.net/bitbashing/posts/csharp.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;For the last month or so, I've been spending some time on a C#
application to perform vulnerability analysis of PHP and ASP code. The
language was imposed on me by external constraints, but it turns out
to be a very reasonable choice for this sort of problem. I'm not doing
anything particularly groundbreaking or clever, so it ends up that
having really good libraries and a reasonably expressive language is
more useful, in terms of immediate productivity, than having a really
powerful language and half-assed library support (see: Common Lisp).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/csharp.html"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><guid>https://randombit.net/bitbashing/posts/csharp.html</guid><pubDate>Thu, 03 Aug 2006 04:00:00 GMT</pubDate></item><item><title>Observation on the SSLv3 MAC function</title><link>https://randombit.net/bitbashing/posts/ssl3mac.html</link><dc:creator>Jack Lloyd</dc:creator><description>&lt;div&gt;&lt;p&gt;SSLv3 uses an early form of HMAC for message authentication
functions (we will denote this MAC as SSL3-MAC for brevity). A
critical point of the security of HMAC (and SSL3-MAC) is that the each
of the transformed keys (termed &lt;em&gt;ikey&lt;/em&gt; and &lt;em&gt;okey&lt;/em&gt;) is
exactly &lt;em&gt;B&lt;/em&gt; bytes long, where &lt;em&gt;B&lt;/em&gt; is the input size of
the hash function (for the MD5 and SHA-1 hash functions, &lt;em&gt;B&lt;/em&gt; =
64).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://randombit.net/bitbashing/posts/ssl3mac.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>crypto</category><guid>https://randombit.net/bitbashing/posts/ssl3mac.html</guid><pubDate>Sat, 11 Jan 2003 05:00:00 GMT</pubDate></item></channel></rss>