Python Trifold2014

17
School’s Cyber Robot Challenge Team CHARGED

Transcript of Python Trifold2014

Page 1: Python Trifold2014

Henry E. Lackey High School’sCyber Robot Challenge TeamCHARGED

Page 2: Python Trifold2014

OverviewChallenge: Guide a Defender Robot through a maze and navigate to a network

exit. Defeat benign bugs and vile viruses by solving cryptography puzzles

and attempt to solve numerically-encrypted secret passphrases.

RobotMazes Cryptography Puzzles

Vile VirusesBenign Bugs

Clues

Page 3: Python Trifold2014

Design: InfluencesPrevious Solutions

Previously used was the follow-the-wall concept, which algorithms consistently fell into infinite loops. Online research indicates algorithms that choose movements

randomly or pseudo-randomly are much more efficient.

Random Walker Pseudo-Random Walker

y

x

Explored Area

Efficiency of Random and Pseudo-random Walkers

Page 4: Python Trifold2014

Markov Chain Monte Carlo Approach

Sample Distribution

A class of algorithms used to explore a nontrivial space efficiently

2D Random Walk

Modified Random WalkExploring space with a tendency to explore new areas

using the following equation:p

Where p is the relative probability of making the move, r is a random number between zero and one, n is the number of previous visits to that location, and w

is the weight placed on number of previous visits

Randomness (r)Allows robot to make “bad” steps occasionally to

ensure entire space can be explored

Weight (w)Defined as four to increase speed of exploration in

likely directions, three to less likely directions, such as south.

Page 5: Python Trifold2014

Program: FinalStorage

A list of visits to previous locations allows for a tendency to explore unvisited areas

List

Location

Number of Visits

(1,0)

0

(0,1)

0

(0,0)

1

Procedure1. Update orientation2. Choose move3. Validate move4. Perform move5. Update list

ValidationValidating after selection for that

iteration limits extraneous sensings

OrientationMovement procedure depends on

orientation and target location

Page 6: Python Trifold2014

Program: OriginalStorage

A list of previous locations allows for a tendency to explore unvisited areas and

store invalid moves

Procedure1. Validate cells2. Store invalid moves3. Choose move4. Perform move5. Update list

List

Location

Number of Visits

(1,0)

0

(0,1)

n/a

(0,0)

1

Cell

EliminationWall-based elimination prevents full

exploration of space

Page 7: Python Trifold2014

Program: ModifiedStorage

A list of visits to previous locations allows for a tendency to explore unvisited areas

List

Location

Number of Visits

(1,0)

0

(0,1)

0

(0,0)

1

Procedure1. Validate cells2. Store invalid moves3. Choose move4. Perform move5. Update list

ValidationValidating before selection for that

iteration increases extraneous sensings

EliminationInvalid moves are eliminated for

current iteration

Page 8: Python Trifold2014

Caesar Cipher

• Named after: Julius Caesar

• Most common beginner cipher

• Used in more complex ciphers

• Currently: OBSOLETE

History

• Choose shift number

• Shift outer ring

• Encrypt plaintext

Implementation

Page 9: Python Trifold2014

Vigenère CipherHistory Implementation

• Named After: Blaise de Vigenère• Created By: Giovan Battista Bellaso

• Currently: OBSOLETE

• Multiple Caesar ciphers

• Choose key word

• Repeat key word to match character count to plaintext

• Assign key word character to plaintext characters

• Replace plaintext with shifted letter from character’s Vigenère Table row

Page 10: Python Trifold2014

Transposition CipherHistory Implementation

• Ciphertext: Permutation of plaintext

• Types: Rail Fence, Route, Columnar,

Double, and Myszkowski

• Choose key word

• Write plaintext crosswise

• Alphabetize key word

• Write columns in alphabetic order

Page 11: Python Trifold2014

Public/Private Key CipherHistory Implementation

• Mathematical Cipher

• Asymmetric Key Cryptography

• No Efficient Cracking Method

• Currently: USED

• Define , , and

• Calculate Public Key (n,e)

• Calculate Private Key (n,d)

• Calculate Ciphertext c

• Calculate Plaintext m

𝒁=𝒂𝟏𝒃𝟏−𝟏𝒆=𝒂𝟐𝒁+𝒂𝟏

𝒅=𝒃𝟐𝒁+𝒃𝟏 𝒏=𝒅𝒆−𝟏𝒁

1

𝒄=𝒆𝒎(𝒎𝒐𝒅𝒏)𝒎=𝒅𝒄 (𝒎𝒐𝒅𝒏)

Page 12: Python Trifold2014

Polybius Square Cipher

History Implementation

• Named after: Greek Scholar Polybius

• Originally a 5 by 5 Square

• Combine Letters I and J

• Currently: Obsolete

• Choose a key word

• Write key word in upper left

• Never repeat letters

• Finish writing remaining letters

• Words into corresponding numbers

Page 13: Python Trifold2014

Team MembersGeorge Jenkins (Team Captain) – 3rd Year - Senior

Wrote main program, Lead Research, Technical Report, Presentation.

Nathaniel Dudley – 2nd Year - JuniorHelped writing code, Technical report, lead Public/Private Key Cipher research.

Mai-lin Quinto – 1st Year - JuniorLead research Transposition, Polybius Square Ciphers, constructed presentation.

Melissa Nelson – 1st Year - JuniorLead research on the Caeser, Vigenère Ciphers, constructed presentation.

Page 14: Python Trifold2014

Python programming environment IDLE

How PGP works. (n.d.). The International PGP Home Page. Retrieved March 10, 2014, from http://www.pgpi.org/doc/pgpintroModular Arithmetic — An Introduction. (n.d.). Mathematics Department - Welcome. Retrieved March 10, 2014, from http://www.math.rutgers.edu/~erowland/modulararithmetic.html

SAS/STAT(R) 9.3 User's Guide. (n.d.). SAS Customer Support Knowledge Base and Community. Retrieved March 10, 2014, from http://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#introbayes_toc.htm

The Black Chamber - Caesar Cipher. (n.d.). Home. Retrieved March 11, 2014, from http://www.simonsingh.net/The_Black_Chamber/caesar.html

Transposition Ciphers. (n.d.). Cornell Mathematics. Retrieved March 12, 2014, from http://www.math.cornell.edu/~mec/2003-2004/cryptography/transposition/transposition.html

Vigenere Cipher. (n.d.). Computer Science. Retrieved March 12, 2014, from http://www.cs.trincoll.edu/~crypto/historical/vigenere.html

can, t. c. (n.d.). Python 101 -- Introduction to Python. Rexx. Retrieved March 13, 2014, from http://www.rexx.com/~dkuhlman/python_101/python_101.html

::: MESA - Maryland :::. (n.d.). The Johns Hopkins University Applied Physics Laboratory. Retrieved March 14, 2014, from http://www.jhuapl.edu/mesa/events/mesaday/

Online resources

School computer Home computer

Materials and References

Page 15: Python Trifold2014

Weak computers and system-intensive programs

Dividing teamwork effectively

Learning ciphers

Developing the maze-solving programs

Solved by: Research and trial and error

Solved by: Evaluating strengths and weaknesses

Solved by: Internet research

Solved by: Use of home computer

Challenges

Page 16: Python Trifold2014

The Ciphers

How to autonomously solve a maze

Python

Modulo arithmetic and other cryptographic mathematical formulae New mathematical concepts and nested equations

Bayesian random walk exploration

Lists, loops, and logical statements

Caesar, Vigenère, Transposition, Polybius Square, and Public/Private Key

What We Learned

Page 17: Python Trifold2014