Tweaked slide layout
authorNeil Smith <neil.git@njae.me.uk>
Tue, 15 Jul 2014 09:57:30 +0000 (10:57 +0100)
committerNeil Smith <neil.git@njae.me.uk>
Tue, 15 Jul 2014 09:57:30 +0000 (10:57 +0100)
15 files changed:
slides/affine-break.html
slides/affine-encipher.html
slides/aims.html
slides/alternative-plaintext-scoring.html
slides/caesar-break.html
slides/caesar-encipher.html
slides/further-work.html
slides/index.html
slides/keyword-break.html
slides/keyword-encipher.html
slides/pocket-enigma-break.html
slides/pocket-enigma-encipher.html
slides/transposition-break.html
slides/transposition-encipher.html
slides/word-segmentation.html

index ddd81706e485395a8032b76b7e5968d38023f3b5..8a07978efa3a38e286e8f15a3787e36845de2621 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
@@ -53,6 +58,12 @@ b | e | h | k | n | q | t | w | z | c | f | i | l | o | r | u | x | a | d | g |
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Duplicate and extend your `caesar_break()` function
 
 * How to cycle through all the keys?
 # Duplicate and extend your `caesar_break()` function
 
 * How to cycle through all the keys?
index 30f3900f7525cb694ce2fdbcb79df60d40b7f9e5..c0f30cb58cb7eb9d2e28f4ea3f809d952f22b516 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
@@ -56,9 +61,16 @@ An extension of Caesar ciphers
 * Count the gaps in the letters.
 
 ---
 * Count the gaps in the letters.
 
 ---
+
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # How affine ciphers work
 
 # How affine ciphers work
 
-_ciphertext_letter_ =_plaintext_letter_ × a + b
+.ciphertext[_ciphertext_letter_] =.plaintext[_plaintext_letter_] × a + b
 
 * Convert letters to numbers
 * Take the total modulus 26
 
 * Convert letters to numbers
 * Take the total modulus 26
@@ -83,11 +95,11 @@ This is not always defined in modular arithmetic. For instance, 7 × 4 = 28 = 2
 
 Result from number theory: only numbers coprime with _n_ have multiplicative inverses in arithmetic mod _n_.
 
 
 Result from number theory: only numbers coprime with _n_ have multiplicative inverses in arithmetic mod _n_.
 
-Another result from number theory: for non-negative integers _a_ and _n_, and there exist unique integers _x_ and _y_ such that _ax_ + _ny_ = gcd(_a_, _b_)
+Another result from number theory: for non-negative integers _m_ and _n_, and there exist unique integers _x_ and _y_ such that _mx_ + _ny_ = gcd(_m_, _n_)
 
 Coprime numbers have gcd of 1.
 
 
 Coprime numbers have gcd of 1.
 
-_ax_ + _ny_ = 1 mod _n_. But _ny_ mod _n_ = 0, so _ax_ = 1 mod _n_, so _a_ = _x_<sup>-1</sup>.
+_mx_ + _ny_ = 1 mod _n_. But _ny_ mod _n_ = 0, so _mx_ = 1 mod _m_, so _m_ = _x_<sup>-1</sup>.
 
 Perhaps the algorithm for finding gcds could be useful?
 
 
 Perhaps the algorithm for finding gcds could be useful?
 
index fcf0c7079e102a4702c2ec7dc0d1c28a3f0efd9f..1d1da36588268bab87a82741210fd61c3e9563d3 100644 (file)
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
       }
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
       }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
+      }
     </style>
   </head>
   <body>
     <textarea id="source">
 
     </style>
   </head>
   <body>
     <textarea id="source">
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Aims
 
 Material aimed for two (three?) audiences
 
 1. Teacher CPD
 2. In-school resources for children
 # Aims
 
 Material aimed for two (three?) audiences
 
 1. Teacher CPD
 2. In-school resources for children
-3. (Outreach resources, mainly Bletchley Park)
+3. Outreach resources, mainly Bletchley Park
 
 After your suggestions on how to extend these notes to hit these audiences
 
 
 After your suggestions on how to extend these notes to hit these audiences
 
index d6f4aa1e35c26d037fa3d6b2f616c5b0478ad93c..1b2b882b831accd3ed9cda4b665a2883f2a28490 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Back to frequency of letter counts
 
 Letter | Count
 # Back to frequency of letter counts
 
 Letter | Count
index 5ea77b9ffb208baa62eb1c4437cad26a6ef19b55..4d2ebfa0d01d556dbdd37599f3e4320f92fc4031 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Human vs Machine
 
 Slow but clever vs Dumb but fast
 # Human vs Machine
 
 Slow but clever vs Dumb but fast
@@ -93,6 +104,8 @@ What does English look like?
 
 How do we define "closeness"?
 
 
 How do we define "closeness"?
 
+## Here begineth the yak shaving
+
 ---
 
 # What does English look like?
 ---
 
 # What does English look like?
@@ -154,6 +167,7 @@ open()
 * Count them
 ```python
 import collections
 * Count them
 ```python
 import collections
+collections.Counter()
 ```
 
 Create the `language_models.py` file for this.
 ```
 
 Create the `language_models.py` file for this.
@@ -279,7 +293,7 @@ Use `logger.debug()`, `logger.info()`, etc. to log a message.
 
 ---
 
 
 ---
 
-# How much ciphertext do we need?
+# Homework: how much ciphertext do we need?
 
 ## Let's do an experiment to find out
 
 
 ## Let's do an experiment to find out
 
@@ -289,6 +303,18 @@ Use `logger.debug()`, `logger.info()`, etc. to log a message.
 4. Score 1 point if `caesar_cipher_break()` recovers the correct key
 5. Repeat many times and with many plaintext lengths
 
 4. Score 1 point if `caesar_cipher_break()` recovers the correct key
 5. Repeat many times and with many plaintext lengths
 
+```python
+import csv
+
+def show_results():
+    with open('caesar_break_parameter_trials.csv', 'w') as f:
+        writer = csv.DictWriter(f, ['name'] + message_lengths, 
+            quoting=csv.QUOTE_NONNUMERIC)
+        writer.writeheader()
+        for scoring in sorted(scores.keys()):
+            scores[scoring]['name'] = scoring
+            writer.writerow(scores[scoring])
+```
 
     </textarea>
     <script src="http://gnab.github.io/remark/downloads/remark-0.6.0.min.js" type="text/javascript">
 
     </textarea>
     <script src="http://gnab.github.io/remark/downloads/remark-0.6.0.min.js" type="text/javascript">
index 3bc519c9b59c27f05785cced5ea703da9f715d8a..4ef1d341125d73a444a6d2cbbc01a7e7dce08c7c 100644 (file)
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
       }
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
       }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
+      }
     </style>
   </head>
   <body>
     </style>
   </head>
   <body>
@@ -50,6 +55,12 @@ Letter-by-letter enciphering
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Enciphering and deciphering
 
 ## Arithmetic on letters
 # Enciphering and deciphering
 
 ## Arithmetic on letters
index 9d217afaeab16dcea0b65cf91241d716b9a02696..34059f8ae03af9b97812b0b8d36cddf9c5364b57 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
   <body>
     <textarea id="source">
 
   <body>
     <textarea id="source">
 
+
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Taking this further
 
 
 # Taking this further
 
 
index 8dfb4e1abfafcaf2043a692a17bce483836be3a5..254581e5ee29c9e049582d2d15c071558bf9312e 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
index 49160bbb4fe394a3a5f9d88a05a797c62b732372..08013f3f0f2d5c21a212040f7dbf06d7d88f86fc 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
@@ -53,6 +58,12 @@ k | e | y | w | o | r | d | a | b | c | f | g | h | i | j | l | m | n | p | q |
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Duplicate and extend your `affine_break()` function
 
 * How to cycle through all the keys? What _are_ all the keys?
 # Duplicate and extend your `affine_break()` function
 
 * How to cycle through all the keys? What _are_ all the keys?
index 168bb5fb78628f7b0161d56641613646d4b62136..be90c688f040732636fb65fec4f152e52093d4f1 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
@@ -55,6 +60,12 @@ k | e | y | w | o | r | d | a | b | c | f | g | h | i | j | l | m | n | p | q |
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # The cipher
 
 * Still character-by-character substitution, still monosubstitution.
 # The cipher
 
 * Still character-by-character substitution, still monosubstitution.
@@ -116,7 +127,7 @@ Use Python 3.4's `Enum`
 ```python
 from enum import Enum
 
 ```python
 from enum import Enum
 
-class Keyword_wrap_alphabet(Enum):
+class KeywordWrapAlphabet(Enum):
     from_a = 1
     from_last = 2
     from_largest = 3
     from_a = 1
     from_last = 2
     from_largest = 3
index 25920429cb4c0f4e0fcd9e5cbb5709d5d4b96a96..f798a509b956ee4d8aa724df990cee93e089e81b 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
@@ -53,6 +58,12 @@ Using cribs
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Breaking the Pocket Enigma
 
 A _crib_ is a piece of plaintext we believe to be in the enciphered message.
 # Breaking the Pocket Enigma
 
 A _crib_ is a piece of plaintext we believe to be in the enciphered message.
index b569911bacd2289c108e6a327ea1bdd9aad42bf0..c89ebaf86a960b655f3404432c25e47ec51f9291 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
@@ -53,6 +58,12 @@ Stateful cipher
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Pocket Enigma
 
 Emulates the Enigma machine from WWII
 # Pocket Enigma
 
 Emulates the Enigma machine from WWII
index 9077c12088456f80e86c03ab3b07c51ce02e93a4..76c4f56abb990cf5e2a6576ab32ea0dbf671f7c8 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
@@ -62,6 +67,12 @@ Generally quite familiar...
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # ...Pick one that looks most like English
 
 But the naïve Bayes score will always be the same!
 # ...Pick one that looks most like English
 
 But the naïve Bayes score will always be the same!
index af03f758de573fd1217cfa80e35a787f04580d79..025f09ade556121b0e839543d35ace78e44bef37 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Transposition ciphers
 
 Rather than changing symbols (substitution ciphers),
 # Transposition ciphers
 
 Rather than changing symbols (substitution ciphers),
index 16fcb0ad8c36c77041e790799046dd580e5128fa..35721ab3fea6fc8529a893cb9d98f06ca8eb7b8d 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
       }
        .float-right {
         float: right;
 
 ---
 
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # The problem
 
 Ciphertext is re-split into groups to hide word bounaries.
 # The problem
 
 Ciphertext is re-split into groups to hide word bounaries.