Discrete Logarithm in Cryptography

Now, if you’ve ever heard someone mention this term in passing and thought “huh? what’s that?” don’t worry, we’re here to help!

To start: let’s define our terms. Discrete logarithm is a mathematical concept used in cryptography (which is the study of secure communication) to ensure that only authorized parties can access certain information. It involves finding an integer x such that when you raise some base number g to the power of x, you get another number h:

g^x = h

This might sound like a simple equation, but it’s actually pretty tricky to solve for x in most cases (especially if we’re dealing with large numbers). In fact, finding discrete logarithms is so difficult that it’s considered one of the fundamental problems in cryptography.

So why do we care about this? Well, let’s say you have a secret message that you want to send to someone over an unsecured channel (like email or text messaging). You don’t want anyone else to be able to read it, so you encrypt the message using some kind of algorithm. One popular encryption method is called RSA, which uses discrete logarithm to generate public and private keys for each user.

When Alice wants to send a secret message to Bob, she first converts her message into an integer (let’s call it m) and then encrypts it using Bob’s public key:

c = g^(m * e) mod n

Here, g is some base number that both Alice and Bob know about, e is Bob’s public exponent (which he shares with everyone), and n is a large prime number that only Bob knows. The “mod” part just means that we take the remainder when c is divided by n.

When Bob receives this encrypted message from Alice, he uses his private key to decrypt it:

m = (c^d) mod n

Here, d is Bob’s private exponent (which he keeps secret), and everything else is the same as before. The “mod” part just means that we take the remainder when m is divided by n.

So how does this all work? Well, let’s say Alice wants to send a message saying “hello”. She converts it into an integer (let’s call it 4) and then encrypts it using Bob’s public key:

c = g^(m * e) mod n

Let’s say that g is 3, e is 5, and n is 17. Then we can calculate c as follows:

c = (3^4)^5 mod 17

This gives us a value of 8. So Alice sends the encrypted message “8” to Bob over an unsecured channel. When Bob receives this message, he uses his private key to decrypt it:

m = (c^d) mod n

Let’s say that d is 12 (which we can calculate using some math). Then we can calculate m as follows:

m = (8^12) mod 17

This gives us a value of 4. So Bob receives the original message “hello”. Pretty cool, right? But what if someone else tries to intercept this communication and read Alice’s secret message? Well, they can try to calculate g^(m * e) for themselves using their own copy of Alice’s public key (which is available to anyone). However, finding the discrete logarithm x such that g^x = h is a very difficult problem. In fact, it’s considered one of the fundamental problems in cryptography!

It might sound complicated at first, but once you get the hang of it, it’s actually pretty simple (at least compared to some other topics in math and computer science). And who knows? Maybe one day you’ll be using this technique to send your own secret messages!

SICORPS