Encryption in .NET

Recently an article went up on MSDN about cryptography with the .NET framework. I've seen many articles like this. Know what? Almost every single one does what this article does - creates helper functions that take a chunk of plain text and return a chunk encrypted text. I must have seen this same chunk of code a dozen different times.

Perhaps this is an indication that the framework needs a couple of high-level encrypt/decrypt-a-string methods. The stuff that's in the framework is great, but apparently it's calling out for a couple of simple additions.

Although then article writers would have to come up with a new boilerplate sample, and it would be a shame to make their live's more difficult.

3 Comments

  • I did notice this morning in my Whidbey bits that some encryption functionality that was previously only available by writing P/Invoke code to access the unmanaged libraries will now be available in the framework. Not sure how much is/is not NDA that I can talk about here, though.

  • Heh. But that's the point, really, isn't it? To make authors' lives more difficult? I mean, surely they aren't going around adding all this functionality just to make *developers'* lives *easier*? ;-)

  • Hi Kev,

    I had a chance to use the .NET Encryption recently (for encrypting a password that is being persisted locally). I'll admit that I had to learn a bit more about cryptography that I might have, but my overall impression was that it was fairly simple and remarkably better than what we've been able to do in the past (remember the early VS encryption? ;))



    It was a bit of a pain dealing with the character set issues, and it would have been nice if the Base 64 encoding were optionally built into the API.

    Tom

Comments have been disabled for this content.