As a side note, remember that that xor-ing a key with a message is trivial to break (it's just a variation on the Vigenere cipher first published in 1568). So don't use if for any real applications.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Nelson Sent: 14 March 2006 15:29 To: tutor@python.org Subject: [Tutor] Iterate over letters in a word Hello, I'm trying to work on some programs to help me understand ciphers and ultimately cryptography. I've understood so far, that a simple form of bit-level cryptography is to split the original message into chunks the same length as a 'key' and then do an xor. I'm trying to keep this really simple so I can understand from first principles - so eg: "Hello Tutors!" could be split into: "Hell" "o Tut" "ors!" and xor'd with "beer" I think I understand how xor works (thanks to an earlier post) but I'm not sure how to iterate over each letter in a string. What is the recommended way to do this? Thanks, S. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor