Modern cryptography relies on the difficulty of certain problems
arising in pure mathematics. I will describe how group theory
and modular arithmetic give an easy to describe "one-way function"
that can be used in a variety of ways, including for spam prevention
and for creating a digital currency requiring no central authority.
No background in group theory or cryptography will be assumed.

The group $\Zp$ is called the cyclic group of order $p$.
It is called "cyclic" because if you start with $1$ and keep adding it to itself, you go through all the elements of the group and eventually end up where you started.

That method takes $p-2$ steps, which is exponential in the number of bits!

The trick is to use Horner's method.
For example,
$
3^{45} = 3^{32+8+4+1} = (3^{32}) (3^8) (3^4) (3^1),
$
and we compute the powers by repeated squaring:
$3^{32} = ((((3^2)^2)^2)^2)^2$ only requires five multiplications!

We believe that there is no method of computing discrete logarithms that is substantially faster than this!

Proof of work

A one-way function can be used for proof of work.

An example of this is the Hashcash anti-spam tool.
Each message I send has a header that looks like this:

X-Hashcash: 1:24:161021:npagliar@uwo.ca::kaw+sLa1OykzF+pL:01LFRH

This header proves that I used some cpu time before sending
the message to generate this stamp. It only took a second
or two, but spammers can't afford to spend one second per message,
so a spam filter is more likely to let my message through.

Here's how we could do this with the discrete logarithm.

We decide on a large prime $p$ and a element $g$ in $\Zpx$
so that the discrete log problem takes about a second to solve
on average.

Then, we combine the current date and the recipient's address
into a string of bits that we interpret as a number $a$ (modulo $p$).

Then we compute $i = \log_g a$ in $\Zpx$, and include $i$ in the header.
The spam filter just has to check that $g^i = a$, which is fast.

Digital currency

Proof of work can also be used to create a digital currency like Bitcoin.

One way to create a digital currency is to create a ledger that records all of the transactions.

This is easy if you have a trusted central authority.
E.g., I could create Dancoin right now (if time).

But how to do it in a distributed way, with untrusted participants?

We make it so that adding new transactions to the ledger
requires such a large amount of work that it takes our combined
computing power about 10 minutes.

Then it's unlikely that one person can influence the ledger.

This is how Bitcoin and most other digital currencies work.

The method solves the Byzantine generals problem, the problem of coordinating information among distributed, untrusted agents with unreliable communication links.