Skip to content

Some simple codemaking and codebreaking resources with the Raspberry Pi

Notifications You must be signed in to change notification settings

guru/picademy-python-codebreaking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

picademy-python-codebreaking

Some simple codemaking and codebreaking examples using Python.

What is it?

This is a series of Python script that introduce basic concepts in Python such as input, output, loops, decisions and using modules. The series finishes with an implentation of a substitution cypher (Ceaser's Cypher) and a brute-force decode function to show an example of how codes are broken.

  1. Input and Output ============================ This is the foundation of human computer interaction. We tell the computer what to do via input. The computers shows us the result of what it does via outputs.

  2. Get the students to type in the code from input.py

  3. Explain what each line of the code is for and run the progr am to demonstrate how this works.

  4. Change the last print line and run to check your response works.

  5. Choices ============================ We will see how computers make decisions based on the different inputs we make.

  6. Type in the code from choice.py

  7. Recap the function of inputs and outputs and introduce the if process and language related to this.

  8. Run the program and explore how different answers receive varied respomses.

  9. Edit the code to alter the responses to questions and change the values required to elicit the response.

  10. Add new responses using the code modelled. Test.

  11. Encode ============================

  12. Model Caesar cypher or substitution cypher using pen and paper.

  13. Enter the code from encode.py

  14. Explain how this recreates the Caesar cypher using python. Point out how the alphabet is chopped up and asigned an offset number. 4.Run the code and enter a word and decode using a paper cypher to check it is correct.

  15. Code Breaking =============================

  16. Explain how Brute force coding works, checking every possible answer to find a suitable response.

  17. Try this by hand first using a paper cypher for a simple word, find a word that makes sense. This will model the labourious process of code breaking.

  18. Enter the code from caesar.py

  19. Explain the lines fo code that show the loops and functions, that remove the need to run this function 26 times.

  20. Run the code, search the responses and has your coded word been decoded in one of the responses.

  21. Children to create a coded phrase and ask the childre to decode this to break the code using the program.

About

Some simple codemaking and codebreaking resources with the Raspberry Pi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages