Updates from December, 2008 Toggle Comment Threads | Keyboard Shortcuts

  • Scott Saad 09:01 on December 30, 2008 Permalink | Reply  

    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.

     
    • gana2k 07:06 on May 13, 2009 Permalink | Reply

      Hi,
      Thanks for the post. I am exactly in the same situation that you outlined in your post.
      Would it be possible for you to share source code for both C++/C#?
      Thanks and much appreciated.

      • Scott Saad 08:31 on May 13, 2009 Permalink | Reply

        Hello,

        Thanks for leaving a comment. I would be happy to post more code if necessary. Were you able to check out the answer I posted over on Stack Overflow? It definitively is more verbose than the post here. This post was more of an introduction into the solution. Please let me know if you need more details after reading the solution on Stack Overflow. I would be happy to help in any way.

        • gana2k 05:54 on May 14, 2009 Permalink

          Yes I did. Your post helped me a great deal in understanding the nuances of cross language issues. I am looking for a working sample for both the C++/C# side. You can contact me at gana2k1@gmail.com.
          I am using win32 crypto api to encrypt some data, base64 encode it and transmit it to the server where c# services need to decrypt and validate. I am having a little difficulty in matching the C# decryption bit.

        • Scott Saad 08:26 on May 14, 2009 Permalink

          I will attempt to round up some code example(s).

        • Scott Saad 08:45 on May 15, 2009 Permalink

          Also, it might be beneficial to post some of the details describing the problem(s) you’re having. It’s something I struggled with for sometime and any problem(s) you encounter can probably be learned from by many others, including myself.

  • Scott Saad 15:15 on December 20, 2008 Permalink | Reply  

    Time Well Spent 

    My time has been divided recently as much is going on. From a missed PDC 2008 event; to a wonderful home birthing experience with our third child; to learning to play more than twinkle twinkle on the guitar; to spending an absorbent amount of time on Stack Overflow.

    hourglass-small

    Like sand through the hour glass, these are the days of my life.

    Yes, I missed this years PDC event due to the encroaching due date of our unborn child. Most of the content is now online so it’s just a matter of time before one can be caught up. The biggest thing that is hard to recover is the people networking that occurs at these events. So many bright minds in the industry come to share the knowledge. There is always next time and for now… I can always connect with people on twitter. :)

    Next came the birth of our third child. We had this one at our house (yes, it was planned that way). All I can say is that the experience was absolutely amazing and a wonderful switch from the hospital environment.

    Where else has the time went? Between family, work and play there is Stack Overflow. A developer’s haven for learning, helping others, etc. It’s a community site for geeks of the software trade to hangout and share their experiences.

    I had the pleasure of being part of their private beta and was addicted from the start. It’s now in public beta and open to everyone (has been for months now). Check it out if you have not yet done so. It has become another tool in the box that assists in climbing out of those crazy situations us developers always seem to find ourselves in. If I didn’t have so many other things going on in my life I’m sure that a majority of my time would be spent at this site.

    Thank goodness for all the other stuff that tends to bring balance to this software developer’s life.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
esc
cancel