> For the complete documentation index, see [llms.txt](https://davidjosearaujo.gitbook.io/online-courses/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidjosearaujo.gitbook.io/online-courses/blockchain-security/fundamentals-of-blockchain-security/what-is-public-key-cryptography/how-does-public-key-cryptography-work.md).

# How does public-key cryptography work?

The two keys used in public-key cryptography are related by a mathematical function

* These functions are "easy" to perform but "hard" to reverse

Commonly used functioons include:

* Factoring
* Discrete logarithm
* Elliptic-curve descrete logarithm

Public-key cryptography is secure as long as these problems remain "hard"

* Quantum computing threatens this
