[Tutor] Iterate over letters in a word

Steve Nelson sanelson at gmail.com
Tue Mar 14 16:29:04 CET 2006


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.


More information about the Tutor mailing list