Mashup: Key Blobs, Win32 CryptoAPI and .NET

A while back I had the pleasure of getting more in touch with my crypto side. It was, and still is, very under-developed. Cryptography (and the surrounding use cases) seems to be one of those elite-like skills that people can spend lifetimes researching and learning more about. Therefore, it generally is difficult to pick up when you run into for the first time.

I had used simple encryption functions with different languages before, but never to the extent at which this project took me. In this case, I had a written a pure C++, Windows dll which produced a session key that needed to be consumed by a .NET application.

It seems that one solution to the complexity (like the .NET framework’s solution) is to make pretty wrappers around the system calls so one doesn’t totally freak out. While this is nice and I think a very natural progression of a framework it actually made it more difficult to solve the problem. Not only is the documentation horrendous for this, it would appear that .NET’s implementation is not really in sync with the native CryptoAPI’s. 

Aside from battling through the documentation over at MSDN, Google searches were coming up blank on this. While working through things I ended up posting the question to Stack Overflow. If any of this stuff interests you at all you can check it out over there. I also ended up posting a solution to the problem once I figured things out, as the help at the overfloweth of stacks was limited.

It’s all very anti-climactic but felt since there was no straight answer anywhere on the web, I would try and share mine in hopes of helping some other lost geeky sole.

-

If you enjoyed this post, it would be rock-a-licious if you subscribed to future updates via rss.