SecurityInnovation/TMContentReview — Issue #195: Retrieve an RSA Key Pair from Registry and Decrypt a Message
Author: SergeTruth
Created: 2011-11-07 23:25:41+00:00
State: open

string keyPairXml = UnicodeEncoding.ASCII.GetString(keyPairBytes);
has the same problem with the key space.
Make sure that you don't replace it with:
UnicodeEncoding.UTF8.GetString(keyPairBytes);
You will have similar problems occur.