[Tutor] [TUTOR]Code Deciphering

2011-12-15 Thread Calle

Hi!

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.


Have a nice day!
//
Calle 


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] [TUTOR]Code Deciphering

2011-12-15 Thread Calle
-Ursprungligt meddelande- 
From: Robert Sjoblom

Sent: Thursday, December 15, 2011 10:34 PM
To: Calle
Cc: tutor@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).
--
best regards,
Robert S.


--
Hi!

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


Have a nice day
//
Calle 


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 94, Issue 58

2011-12-16 Thread Calle

Message: 1
Date: Thu, 15 Dec 2011 23:37:49 +0100
From: "Calle" 
To: "Robert Sjoblom" 
Cc: tutor@python.org
Subject: Re: [Tutor] [TUTOR]Code Deciphering
Message-ID: 
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original

-Ursprungligt meddelande- 
From: Robert Sjoblom

Sent: Thursday, December 15, 2011 10:34 PM
To: Calle
Cc: tutor@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).
--
best regards,
Robert S.


--
Hi!

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

Have a nice day
//
Calle



--
--

Message: 3
Date: Fri, 16 Dec 2011 00:53:35 +0100
From: Robert Sjoblom 
To: Calle 
Cc: tutor@python.org
Subject: Re: [Tutor] [TUTOR]Code Deciphering
Message-ID:

Content-Type: text/plain; charset=ISO-8859-1

On 15 December 2011 23:37, Calle  wrote:

-Ursprungligt meddelande- From: Robert Sjoblom
Sent: Thursday, December 15, 2011 10:34 PM
To: Calle
Cc: tutor@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?


Wll... 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.


Well, I don't really know where to begin. I tried looking at other peoples
code and write something based on that, but it ended up being too similair
to the original code... I could show you what I came up with using
pseudo-code.

Get the cipher from user.
Use ord() to convert into numbers.
Add number to a new string while at the same time making it into a letter 
using chr().

Repeat 25 times and print the results.

Am I on the right track with this or should I re-think?

//
Calle 


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] [TUTOR]Code Deciphering(Re-sent)

2011-12-16 Thread Calle

On 15 December 2011 23:37, Calle  wrote:
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).

--
best regards,
Robert S.




>Sorry, I meant ciphers. How would a basic script for solving

move-one-step-to-the-right ciphers look like?




Wll... 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.



Well, I don't really know where to begin. I tried looking at other peoples
code and write something based on that, but it ended up being too similair
to the original code... I could show you what I came up with using
pseudo-code.

Get the cipher from user.
Use ord() to convert into numbers.
Add number to a new string while at the same time making it into a letter
using chr().
Repeat 25 times and print the results.

Am I on the right track with this or should I re-think?

//
Calle 


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor