[Tutor] [TUTOR]Code Deciphering

Robert Sjoblom robert.sjoblom at gmail.com
Fri Dec 16 00:53:35 CET 2011


On 15 December 2011 23:37, Calle <Calle_Python at live.se> wrote:
> -----Ursprungligt meddelande----- From: Robert Sjoblom
> Sent: Thursday, December 15, 2011 10:34 PM
> To: Calle
> Cc: tutor at python.org
> Subject: Re: [Tutor] [TUTOR]Code Deciphering
>
>
>> I was wondering, how do you use Python to decipher codes? It feels like it
>> should be pretty simple, but I haven't found any tutorials about it yet.
>
>
> What kind of codes? Or do you mean ciphers? Generally speaking, a code
> represent letters or numbers in transmitting a message. In other
> words, a code deals with phrases and sentences or whole words. Example
> "steal the cabbage at dawn" could mean "kill the king on wednesday".
>
> A cipher deals with letters. It is a message written in letters in a
> predetermined code. This means that a cipher is a system of
> communication that uses letters instead of phrases. Examples being the
> standard Caesar cipher where "APPLE" might be written "BQQMB" (ie,
> shifted one letter to the right).

> Sorry, I meant ciphers. How would a basic script for solving
> move-one-step-to-the-right ciphers look like?

Weeeell... There are different ways to solve that, but show us what
you've come up with so far and we might be able to point you in the
right direction. You won't learn anything by getting the answer posted
and just copy-paste it for whatever (nefarious) use you need it;
you'll learn a lot more if you work toward the solution yourself. I'll
just point you in the direction of ASCII values for now.

-- 
best regards,
Robert S.


More information about the Tutor mailing list