I am trying to understand RSA encryption but the algorithm seems quite complex.

I know that with asymmetric encryption you use a key and a function to encrypt data and a different function to decrypt it.

I understand the xor-ing used in most basic symmetric algorithms (functions). The same key (a series of bits of the same length as the plain data is used to encrypt and decrypt). This is possible because the xor function is symmetric (from what I know).

What are some examples of asymmetric functions? What is the function that you use to encrypt and what is the function you use to decrypt and how do you compute the second argument of the function (the first one being the data you are trying to encrypt/decrypt)?

  • 1
    You may want to ask this question to the crypto community. You will probably get a more technical and reasoned answer there. Mar 20 '16 at 19:24
  • If you think of algebraic theory, then an asymmetric function would be one that is not its own inverse. Mar 20 '16 at 19:25
  • That is correct. That is what I had in mind when I said symmetric ( I am not sure if it is the right term though). So xor is symmetric because the inverse of xor is xor. Is there any other definition of symmetric function?
    – yoyo_fun
    Mar 20 '16 at 19:29
  • 1
    RSA isn't that complicated, actually. You can do it on paper and there is a simple example on the wiki that may help you to understand what is happening there. Rather than trying to understand schemes that are simpler (they exists, but are insecure), you may as well understand RSA. You only need to know a tiny part of maths to understand that (and parts of it you learned when learning to tell the time)
    – Tobi Nary
    Mar 20 '16 at 19:45
  • 1
    Brent - we have a rule: Be Nice! You are very close to overstepping the line here. I will respond to flags.
    – Rory Alsop
    Mar 20 '16 at 20:49

RSA is about the simplest known instance of asymmetric encryption. There are a few others, but all of them rely on mathematics.

Symmetric encryption is easy (conceptually), because it is just about making a big knot with the data, and remembering how the knot was made; with that knowledge (that's the "key") you can untie the knot, basically by undoing all operations in reverse order.

Asymmetric encryption requires something magical. If you want to go with the knot metaphor, then it is a kind of knot where even knowing how things were tied up does not reveal how to untie them. In cryptographic terms, it must not be feasible to recover the private key (which is the power to decrypt data), even if the public key (the power to encrypt data) is known. Private and public key share a common mathematical structure, since one decrypts what the other encrypts, but that structure must resist analysis.

In this answer, I tried to explain RSA in simple terms. If you want to understand asymmetric cryptography, then you have to grasp enough mathematics to understand RSA. The good news is that such knowledge is not that hard, and it is reusable. So I encourage you to work up your algebra. Basically, you have to get familiar with the notion of computing things "modulo" an integer.

  • I remember a dictionary metaphor being useful. Mar 20 '16 at 20:24
  • Is this "modulo" the modulo from C programming language: with the % symbol ?
    – yoyo_fun
    Mar 20 '16 at 20:26
  • 1
    @yoyo_fun: it is, except that in order to reach decent security (i.e. resistance to attackers who know their maths), RSA is done with integers which are quite bigger than that C offers. With C, integers are up to 64-bit, but with RSA we usually handle 2048-bit integers. Some libraries (e.g. gmp) or programming languages have support for big integers (e.g. Java's BigInteger class). Mar 20 '16 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.