Chapter 24 – Public Key Cryptography and the RSA Cipher 421
and can be predicted, meaning that a hacker could figure out which “random” numbers were used
for the prime numbers of your private key.)
You’ve seen how all the previous ciphers in this book have each been hacked and rendered
worthless. In general, you don’t want to write your own cryptography code for things you want to
keep secret, because you will probably make subtle mistakes in the implementation of these
programs. And hackers and spy agencies use these mistakes to hack your encrypted messages.
A cipher is only secure if everything but the key can be revealed but still keep the message a
secret. You cannot rely on a cryptanalyst not having access to the same encryption software or
knowing what cipher you used. Remember Shannon’s Maxim: The enemy knows the system!
Professional encryption software is written by cryptographers who have spent years studying the
mathematics and potential weaknesses of various ciphers. Even then, the software they write is
inspected by other cryptographers to check for mistakes or potential weaknesses. You are
perfectly capable of learning about these cipher systems and cryptographic mathematics too. It’s
not about being the smartest hacker, but spending the time to study to become the most
knowledgeable hacker.
I hope you’ve found this book to be a helpful start on becoming an elite hacker and programmer.
There is a lot more to learn about programming and cryptography than what is in this book, but I
encourage you explore and learn more! One great book about the general history of cryptography
that I highly recommend is “The Code Book” by Simon Singh. You can go to
http://invpy.com/morehacking for a list of other books and websites to learn more about
cryptography. Feel free to email me your programming or cryptography questions at
[email protected].
Good luck!