Question

Interesting paper from Trinity College of Dublin:
AES Encryption Implementation and Analysis on Commodity Graphics Processing Units

Their technique uses openGL to enlist the GPU to do the numeric transforms required by AES.

How difficult would it be to expose this capability - performing stream encryption - via a managed .NET library?

How would I get started? Hints? Examples?

EDIT: Anyone have experiences to relate using CUDA or Accelerator?

Was it helpful?

Solution

You could use Microsoft's Accelerator library. It gives you access to the GPU through .NET.

After looking into the work required more, this is a pretty non-trivial thing to do (unless you like re-writing AES algorithms). It is possible however.

There may be other C# API's out there, but one I came across was Bouncy Castle API. What you would have to do is take Microsoft's Accelerator API and use it anywhere a math operation is performed within the source code of the AES algorithm.

OTHER TIPS

I suggest creating a managed wrapper around a CUDA/(c++/cli) implementation OR using cuda.net to do everything but the kernel itself in c#. There is really no way to do the actual kernel implementation in a high-level language, with CUDA you need to use c, with opengl/directx you need to use shaders. To get started either take a look at cuda.net or download the CUDA SDK and examples to get an introduction to gpgpu programming.

Another option is Brahma (the web site seems to be down atm).

Web site Quote:

What is Brahma?

Brahma is an open-source library written for the .NET 3.5 framework (in C# 3.0), to provide high-level access to parallel streaming computations on a variety of processors. Please note at while at this time Brahma has a GPU provider (and its focus is GPGPU), it can be adapted to run on any kind of processor.

What can I do with Brahma?

Brahma 2.0 uses C# 3.0's new LINQ syntax to specify streaming transformation of data. Using Brahma, you can mix statements that run on the GPU and statements that run on the CPU inside a single method! With absolutely no glue code required, a complex multipass GPU computation with intervening CPU operations can be performed with just a few lines of code. All the glue and shader code required is automatically generated by Brahma. All you need to do is write high-level .NET code.

I haven't used it but I just recently listened to a podcast about it on .NET rocks. It sounds like a good library to use if you don't want to get into learning the GPU shader language(s).

Here is the sourceforge link.

Whatever you use to integrate C# to the GPU, you should use a CUDA implementation of AES. They are the fastest out there. The fastest implementation looks like it comes from the same guys you linked to - Trinity group. Look at the Practical Symmetric Key Cryptography on Modern Graphics Hardware paper.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top