Reputation: 105
I'm using the RSACryptoServiceProvider to do some asymmetric encryption.
As per MSDN, when you instantiate a new RSACryptoServiceProvider, you get a public/private key pair generated for you that you can use.
Clearly this pair is being generated using some defaults - specifically the length. I'd like to specify my own length for greater security.
How can I do this?
Thanks in advance.
Upvotes: 0
Views: 411
Reputation: 10447
http://msdn.microsoft.com/en-us/library/d0c0sch1.aspx
public:
RSACryptoServiceProvider(
int dwKeySize, // <- wow a size!
CspParameters^ parameters
)
Upvotes: 0
Reputation: 273169
One of the constructors for RSACryptoServiceProvider takes a KeySize as parameter. Do consult the docs about allowable values though.
Upvotes: 2