Cryptographer's Anthem

Lyrics © 1995 Stephen Savitzky. CC-by-nc-sa\  To the tune of ``To Anacreon in Heaven''

Lyrics [pdf] [txt] [cho]

A A_2 ;A B E
  Oh, say, PGP, and R S A publ ic k ey
A A_2 A E A B E
Crypto syst ems  are  simple, with  primes $q$  and  $p$;
A A_2 A B E
Call the  product of one less  than  each of  them  $k$
A A_2 A E A
I pick  $d$  and  $e$,  whose product  is $1\bmod k$.
A A_4 A A_4 A E A E7
  Now I just  publ ish $d$,  and  the  prod uct  $qp$,
A A_2 A E7 A B E
You raise  $d$  to  the  power of  message  block  $b$;
A E A EA DE A E
Take that  modul $pq$ and  send  it  to me .
A E A D A E A D E7 A
And I'll  use  it  as  the  exponent  of  priv ate  key  $e$.

Now this program can fit into three lines of code,
Using perl and dc, though the logic's distorted.
Cryptographic machines are a weapon of war,
And the government says they must not be exported.
Make a barcoded card, or if you are a bard
run the code through a modem, it's not very hard.
   Now, if I were being mean I'd stick some modem tones in here
Then this song would be a munition, its music you could never take
From the land of the free, and the home of the brave.

The description of the RSA public key crpytography algorithm is mathematically accurate; though it's worth noting that any practical implementation will do the exponentiation and modules in a single operation. Perhaps the only obscure point occurs when specifying that $de \equiv 1 \bmod (p-1)(q-1)$. The twisted phraseology that defines $k$ as $(p-1)(q-1)$ is particularly kludgy, but what the hell, it scans.