Geeks With Blogs
Simon Cooper Peering into the depths of .NET February 2012 Entries
Oh no! My padding's invalid!
Recently, I've been doing some work involving cryptography, and encountered the standard .NET CryptographicException: 'Padding is invalid and cannot be removed.' Searching on StackOverflow produces 57 questions concerning this exception; it's a very common problem encountered. So I decided to have a closer look. To test this, I created a simple project that decrypts and encrypts a byte array: // create some random data byte[] data = new byte[100]; new Random().NextBytes(data); // use the Rijndael ......

Posted On Tuesday, February 28, 2012 12:33 PM

Inside the Concurrent Collections: ConcurrentDictionary
Using locks to implement a thread-safe collection is rather like using a sledgehammer - unsubtle, easy to understand, and tends to make any other tool redundant. Unlike the previous two collections I looked at, ConcurrentStack and ConcurrentQueue, ConcurrentDictionary uses locks quite heavily. However, it is careful to wield locks only where necessary to ensure that concurrency is maximised. This will, by necessity, be a higher-level look than my other posts in this series, as there is quite a lot ......

Posted On Wednesday, February 22, 2012 6:47 PM

Copyright © simonc | Powered by: | Join free