title: RSA: Using public key for decryption in .NET?
body: <p>I'm having issues with the RSA encryption/decryption capabilities of MS .NET:</p>
  
  <p>It seems, <a href="http://ox.no/posts/why-cripple-the-net-rsa-implementation" rel="nofollow">.NET does not support</a> using a private key for encryption and the corresponding public key for decryption. (As I understand, doing it that way round, somehow infringes the security of the algorithm.)</p>
  
  <p>Ok, but for example when I sign an assembly on building, it seems <a href="http://www.csharp411.com/net-assembly-faq-part-3-strong-names-and-signing/" rel="nofollow">the compiler just does that</a>: "The compiler encrypts the digest using the 1024-bit private key from your public-private key pair file."</p>
  
  <p>So, if I cannot convince the RSACryptoServiceProvider to use a public key for decrypting, how can I achieve something similar like the compiler?</p>
  
  <p>I just want to encrypt a few bytes with my private key and decrypt it with the public key, for some non-critical task. If a programming geek manages to break that scheme, I'll live. I just want to prevent the non-tech-savvy John Doe from snooping around.</p>
  
  <p>Any advice on this would be appreciated.</p>
  
  <p>Greets
  berntie</p>
  
  <p>Edit: Usign SignData() and VerifySign() has been suggested, but then I can only compare hashes for equality. However, I need to retrieve the original input that was encrypted/signed.</p>