3.2 The String Data Type

For almost as long as people have been writing, people have also been trying to hide what they were writing from others. Herodotus describes the use of “secret writing” that saved Greece from being conquered by Xerxes and the Persians. The Kama Sutra, ancient Hindu writings, instructs women in the art of secret writing so that they can hide the details of their liaisons. In this chapter, we explore some simple forms of secret writing using Python.

Today this art of secret writing is called cryptography. You use cryptography nearly every day without even thinking about it. Your use is not because you are sending secret messages to your friends (although several cryptographic add-ons are available for email these days), ...

Get Python Programming in Context, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.