views:

458

answers:

2

Following up on this question, I would like to know what an RSA key is, and how I would go about creating and using one.

Thanks in advance.

+6  A: 

From Wikipedia:

In cryptography, RSA (which stands for Rivest, Shamir and Adleman who first publicly described it ; see below) is an algorithm for public-key cryptography. It is the first algorithm known to be suitable for signing as well as encryption, and one of the first great advances in public key cryptography. RSA is widely used in electronic commerce protocols, and is believed to be secure given sufficiently long keys and the use of up-to-date implementations.

Have you looked at the RSACryptoServiceProvider class? .NET makes this easy for most applications.

Ed Swangren
I'd implore you to read these blog posts before implementing encryption http://www.codinghorror.com/blog/archives/001267.html and http://www.codinghorror.com/blog/archives/001275.html
Nathan Koop
+1  A: 

There are two kinds of encryption: symmetric and asymmetric.

Symmetric crypto uses a single key that is shared between the sender and the receiver.

Asymmetric crypto, a.k.a. public-key cryptography, uses two keys (a key pair), one of which (the private key) is kept secret and the other (the public key) is made available to everyone else. The sender uses the public key of the receiver to encrypt data, and the receiver uses his private key to decrypt it.

RSA is an asymmetric/public-key crypto scheme.

AES is a symmetric crypto scheme.

Hybrid schemes combine both, so that the data is encrypted using symmetric encryption, but the encryption keys themselves are encrypted, stored, and exchanged using asymmetric encryption.

So you need to figure out how you intend to manage the encryption keys. If you're designing a system that only needs to encrypt things (e.g., SSNs or passwords) to save them to a database and then later decrypt them when it needs to use them, then symmetric crypto is appropriate. If you're intending to transmit encrypted info across different systems, then asymmetric (or hybrid) crypto is appropriate.

Loadmaster