4 ms·
> Also, how do you actually use the keys to encrypt/decrypt? One of the changes in modern cryptography compared to stuff from the 1990s is that we rarely have
by tialaramex 6y ago
> Also, how do you actually use the keys to encrypt/decrypt?
One of the changes in modern cryptography compared to stuff from the 1990s is that we rarely have cause to use public key encryption at all.
A typical modern design uses a key agreement algorithm to choose a large shared secret known to both parties which is then used to do encryption with symmetric algorithms.
The elliptic curves show up in the key agreement algorithm and in a Digital Signature scheme used after the encryption switches on to prove who you really are, but we often don't use them to actually encrypt anything (and so likewise we don't use them to decrypt anything either).
- alecbenzer 6y agoSure, fine, but even in RSA signing there's some message you transform with one of the keys and then undo the transformation with the other key (the transformation is encryption when the first key is the public key, and signing when the first key is the private key). I just mean, given these EC keys, how do you actually apply them to data?
- tialaramex 6y agoI mean, firstly, no. What you're describing is what we call "Textbook RSA" and that's a classroom exercise rather than a technology you should use in practice - it's unsafe. Perhaps more importantly while you can (almost) do this in RSA you really can't do it with something like Curve25519. As a classroom exercise you can use RSA to encrypt the message "I like toast". You turn "I like toast" into a big number. Using a public key you do the (textbook) RSA operation and out comes a different big number. The recipient uses the private key to get the first big number back - and it translates as "I like toast". Nobody did that in real crypto systems, even in the 1990s, and the way you'd do it as a classroom exercise is inherently unsafe, but you can watch it being done and it's somewhat helpful in understanding RSA. Nothing like that is usually done with elliptic curves. Fortunately we didn't want to send a message like "I like toast" with public key crypto anyway, we always actually want to agree symmetric cryptographic keys. And agreeing keys we can do with elliptic curves. Such as https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93... What's the difference? The key agreement protocol doesn't let you choose the message. Alice and Bob will definitely agree on some shared key at the end of the protocol, but neither Alice nor Bob can choose what it is. For a key this doesn't matter, indeed it's arguably desirable to use random keys nobody actually picked, lots of things to like about that outcome. Does that help?
- alecbenzer 6y ago> I mean, firstly, no. What you're describing is what we call "Textbook RSA" and that's a classroom exercise rather than a technology you should use in practice - it's unsafe. ? I'm not talking about encrypting data with RSA, but how else do you perform signing with RSA except by using the private key to transform some message that can then be verified with the public key? I see now the article's trying to describe elliptic curve Diffie-Hellman, which makes much more sense (but makes the comparison to RSA in the article confusing...)