# RSA: how does it work and how is it more secure than symmetric systems

Before starting the question, I know that RSA is naturally a key exchange cryptosystem rather than an antilogarithm fully implemented for encrypting and decrypting data since the length of the secret data relies on the key size of RSA. Now, we know that RSA is asymmetric means it has a public key and a private key.I know that one should not be able to decrypt an encrypted key using RSA by the public key while the secret is decryptable by the private key. I've also read that (may be I'm confused and mistaken) the public key is calculated based on the private key.

Now I have some questions, when using this algorithm in C# using the cryptography namespace, we have to serialize and export the private members of the key (private key) to be able to decrypt the secret. So what is the purpose of the public key, how is it public at all, and how does it introduce a higher level of security to the algorithm.

Let's say I do the same using AES, then I'm gonna have two Keys (Key, IV) which are only shorter in size. Except for the length of key, how RSA is more secure than AES then. If I don't exchange the public key, what is the purpose of it, if I do but nobody can use it to break the secret then what is the purpose of it again?

• Comparing RSA to AES in terms of security is like comparing apples and oranges. They have very different benefits and use cases and are often used in conjunction, not as competitors. – mikeazo Jan 26 '15 at 13:59
• @mikeazo: No I don't do this, I wanna know the concept behind public - private keys. The AES example is just to question the behavior of RSA. – Dev Arc Jan 26 '15 at 14:02
• You state in your question "how RSA is more secure than AES then". Sounds to me like you are asking for a comparison. If that is not your intent, I suggest you clarify the question. – mikeazo Jan 26 '15 at 14:05
• @mikeazo: I mean what is purpose of the public key. Imagine we don't know about the mechanism of these two algorithms and we are looking at them from the perspective of someone who does not know what public key or symmetric cryptography is. If telling that person the public key is not useful for breaking the secret, we will be asked then why is it used at all? do you get what I mean? – Dev Arc Jan 26 '15 at 14:08
• As far as key length, longer key length for RSA is because it's much weaker than AES with comparable key length. A 2048-bit RSA key is significantly weaker than a 128-bit AES key (it provides about the security of a 112 bit symmetric key; it takes 3072 bit RSA keys to equal 128 bit symmetric keys). – cpast Jan 27 '15 at 1:43