Tuesday, November 25, 2008

Parallel Cryptography

I was again going through my reading list (lately I've had a lot of time to catch up with my reading) and an article from Dr. Dobb's journal caught my eye: an article about a parallel implementation of MD6. It's not really rocket science that some of these algorithms can be parallelized, but what is more important is how they did it. The following snippet doesn't do much justice to how easy possibly the future of parallel programming with C++ can be.

The full MD6 application has over 3,000 lines of code. Adding two Cilk keywords (at the bottom of the code snippet below) was sufficient to multicore-enable the algorithm. MD6 is recursive, and adding the Cilk++ keywords exposes a great deal of parallelism.

from Multicore and Cryptographic Hash Functions

Imagine being able to multi-core enable your code with just keywords instead of thinking about how to implement/use threads and thread pools. Of course you still have to know where to introduce the parallelism, where the problem can usually be.

It takes some effort in designing and implementing algorithms that will be able to take advantage of the parallelism available in the hardware and it's no joke implementing a robust cryptographic function at the same time. It's really something else when an algorithm is designed to be implemented in parallel.

I would think it's just a matter of time before we start seeing more of the upcoming implementations be more parallelism aware than we currently are seeing.

1 comments:

Josué Gomes said...

Image manipulation is other field that can benefit from parallelism. The guys of GraphicsMagick image processing library (http://www.graphicsmagick.org/) have introduced parallelism to version 1.3