assymetric crypto

2 minute read Published:

assymetric crypto with an example

Finally, I’ve found that explaination about assymetric crypto;

One of the most common and famous examples of asymmetric encryption is actually something that can be understood if you know how to do exponentiation. It goes something like this:

  • I come up with a number X, and publicly tell you it. [Let’s say X = 7]

  • I also come up with a number A, but don’t tell you it. [Let’s say X = 4]

  • You come up with a number B, and don’t tell me it. [Let’s say X = 3]

  • You figure out what X^B is and send me THAT number. [ 343 ]

  • I figure out what X^A is and send you THAT number. [ 2401 ]

  • You take the number that I sent you (X^A) and then raise it by your secret number B. So now you have (X^A)^B. [ 13841287201 ]

  • I likewise take the number that you sent me and raise it by my secret number A. So now I have (X^B)^A. [ 13841287201 ]

Note that these two resulting numbers are the same number. Because the way exponentiation works – if you’ve forgotten – is that raising a number to two numbers in a row is the same as raising that number by the multiple of those two numbers. (X^A)^B = (X^B)^A = X^(BA) So we end our conversation with the same secret number [ 13841287201 ]. ```