Search code examples
encryption-asymmetric

Asymmetric Key Systems?


I understand the basic system of public vs. private keys and how if I want to send a person something, I need their public key and they decrypt with their private key, but what kind of logical mechanisms are at play so that a private key can decrypt what a public key encrypted? For example, say I wanted to write my own asymmetric key system. How would I go about generating these keys in pairs and how would I implement them?

I know there's not just one way to do it, but I am just trying to wrap my head around any way of doing it.


Solution

  • All these systems are based on mathematics. Check out

    http://en.wikipedia.org/wiki/Rsa_encryption

    it goes through the math.

    At one point I actually understood that stuff ;)

    To generate the keys, you would need some extremely large prime numbers (for them to be useful in practice, you can do it with 7 and 11 if you want, but thats not so secure).