[Mono-winforms-list] RSA signing with sha256

Sebastien Pouliot sebastien at ximian.com
Sun Mar 11 11:22:57 EDT 2007


Hey,

Mono-winforms-list isn't the right list for crypto questions.

On Sun, 2007-03-11 at 13:58 +0200, Sigron, Ilan wrote:
> Is it possible to hash data with SHA256 and then sign the result using
> RSA (2048 bit) with C#?

Assuming that by C# you mean the .net framework(*) then the answer is...
probably.

- MS Fx 1.x didn't support it because it depends on CryptoAPI (which
doesn't support the new SHA-2 digests).

- I've not checked if MS Fx 2.0 (or 3.0) does support them - but I think
it would hit the same CryptoAPI limitation. MS Fx 3.5 crypto will depend
on CNG, so I'm pretty sure this will be supported (once released).

- Mono Fx (both 1.x and 2.0) supports signing SHA-2 digests (256, 384
and 512) with RSA keys. However MS changed the SHA-2 digest OID between
1.x and 2.0, so verifying the signature can cause a problem (if the
verifying code doesn't know about them).

- If you use the MS runtime you can cheat around the limitation by using
the RSAManaged class available in the Mono.Security.dll assembly (which
works fine under MS runtime). It's slower (100% managed) but it doesn't
have the limitations.


(*) otherwise you can do anything with C# as long as you code it
yourself ;-)
 
> 10X,
> Ilan.
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
-- 
Sebastien Pouliot  <sebastien at ximian.com>
Blog: http://pages.infinit.net/ctech/



More information about the Mono-winforms-list mailing list