Henri Bunting's Portfolio

Summary

Highly passionate, educated, and experienced in the cross section of programming, data science, and security. Exploratory, well-intentioned, straightforward personality. Driven, focused, beauty-in-simplicity work mentality. Seven years work experience. Eight years experience living abroad.

Project List

SVC on Images

K-Means on Images

Filtering Proxy

Neural Network for Identifying
Images Containing
Steganographic Content


Steganography

Solvers
  • The Witness Line Puzzles
  • Sudoku
  • Nonograms
  • Futoshiki

Cryptography
  • Hacknet
  • Enigma Machine
  • Various: RSA, DES, Vigeneer, OTP
Downloaders
  • Youtube
  • Twitch
  • Site mirroring
Video Games

Support Vector Clustering on Images

Implement the SVC method on images. SVC is a deviation from the traditional Support Vector Machine classifier, allowing an unsupervised clustering of the data.

KMeans on Images

I implemented and applied the classic kmeans on images to do segmentation. The goals are to emulate a nice aesthetic style and also experiment with image classification on clustered image data. Of course the implementation is scale-able / multithreaded.

Base Image. Standard euclidean distance clustering in the 5 dimensional Row, Column, Red, Green, Blue space. Standard euclidean distance clustering in the 3 dimensional Red, Green, Blue space. Distance function penalizing gray values. Distance function penalizing spatial distance.

Variants and examples

Clustering methods beyond simple image-based kmeans.

Time Series Clusterer
Take an image time series (video)
Cluster across the 6 dimensional feature space : Row, Col, Time, Red, Green, Blue
Original Clustered Cluster 0 Cluster 1 Cluster 2
Mixer
  • Pick random images
  • for each image:
    • cluster image
    • add random cluster from image
Patch
Set K high, disable distance component, stop after first iteration.
Cluster on RGB values and immediate adjacency. 700 clusters, cluster on distance and RGB values. 500 clusters, cluster on RGB values, brightness, and immediate adjacency.

Filtering Web Proxy

Small, light-weight filtering proxy. Major use case is a privacy proxy and adblocker for use as a privacy tool / ad-blocker over a VPN. Traditional firewalls filter on a system level, effectively useless when using a VPN.

Internet< System Firewall< VPN service< Filtering Proxy< Browser

Neural Network for Identifying Images Containing Steganographic Content

The Goal was to apply Neural Networks to images and identify if an image has a hidden, steganographic embedding. I worked specifically for finding a good parameter set for the network. First, I implemented my own network with simple gradient descent and later conjugate gradient methods. Eventually, I wanted to try other optimization methods, so I reimplemented the network in Tensorflow.

Steganographic Content

For my application, I assumed traditional steganographic approaches. That is, divide the image into channels (R,G,B). Then, pick a channel and look at the 8 bit planes for the pixel color values of that channel.

Here is a visualization of the 8 different bitplanes for the Red, Green, and Blue channels, along with the a visualization when the image has embedded data. Here, I used a simple ASCII embedding of Alice in Wonderland.
Bitplane 1
1
Bitplane 2
2
Bitplane 3
4
Bitplane 4
8
Bitplane 5
16
Bitplane 6
32
Bitplane 7
64
Bitplane 8
128
Bitplanes 1-8
Composite
Original R
Original G
Original B
Original RGB
Embedded data in G at various layers
G
Embedded data in G at various layers
G composite
Embedded data in G at various layers
RGB
Embedded data in G at various layers
RGB composite

I used primarily the Caltech 256 image set - ~30000 natural images of mixed subject matter and mixed resolutions.

Neural Network Content

Initially, I tried to learn on the whole image. I found that this was impracticable due to computational complexity, so I switched to learning on various sized patches. I tried 16x16, 32x32, 64x64, 128x128, and 256x256, sized patches. Using patches better handled the complexity in dealing with images of mixed resolutions.

Steganography

Data hiding in various media. Here, an example of image carrier (~30Kb) media with a small embedded plain-text file and various embedding methods.
Bottom row is the embedding mask, showing where the embedded data is. Last image has a different, much larger file embedded.

Base Image Sobel Mean-Square-Error Luma Mean-Square-Error with a 16Kb file embedded

Solvers

A collection of my various puzzle-solvers using constraint satisfaction.

The Witness Solver

A puzzle solver for the game The Witness. A couple in-game puzzle examples:

A fictitious puzzle. ƒ represents a feature. In this case, a 2x2 in the lower left, and an 3x3, L-shape in the middle. Here, the solver is treating the two shapes unconnected, which will result in a fail-state.

1 step before reaching the fail state.
++ ++ ++ ++ ++ ++ ++ ++ ++ ++ **
++ __    __    __ ++ __ ++ __ ++
** ## ## ## ##    ++ ++ ++ ++ ++
++ __    __ ## ƒ_ ++ __ ++ __ ++
++          ##    ++ ++ ++ ++ ++
++ ƒ_    __ ## __ ++ __ ++ __ ++
** ++ ++ ++ ** ++ ++ ++ ++ ++ ++
The fail state realized.
## ## ## ## ## ## ** ++ ++ ++ **
## __    __    __ ++ __ ++ __ ++
## ## ## ## ##    ++ ++ ++ ++ ++
   __    __ ## ƒ_ ++ __ ++ __ ++
            ##    ++ ++ ++ ++ ++
   ƒ_    __ ## __ ++ __ ++ __ ++
** ## ## ## ##    ++ ++ ++ ++ ++
A correct goal state realized. (Path guessing order is top, down, left, right - hence the snaking.)
                  ## ## ##    **
   __    __    __ ## __ ## __ ##
                  ##    ##    ##
   __    __    ƒ_ ## __ ## __ ##
                  ##    ##    ##
   ƒ_    __    __ ## __ ## __ ##
** ## ## ## ## ## ##    ## ## ##

Sudoku

Example puzzle "hard 07". Initial state:
3  |   | 46
  7| 8 |   
   |76 |5  
--- --- ---
   | 48|3  
   |6  |  9
  2|  1|   
--- --- ---
   | 2 |6 3 
   |9  |   
 59|   |8 1

Puzzle is solved after examining 3 possible states and their respective knowledge propagations:
([] represent the possible values for that square, () the row,column position.)

State After Initial Propogations
------------------------------
[3](0,0)     [1289](0,1)  [158](0,2)   [125](0,3)   [59](0,4)    [29](0,5)    [7](0,6)     [4](0,7)     [6](0,8)     
[1456](1,0)  [146](1,1)   [7](1,2)     [135](1,3)   [8](1,4)     [34](1,5)    [9](1,6)     [13](1,7)    [2](1,8)     
[149](2,0)   [1249](2,1)  [14](2,2)    [7](2,3)     [6](2,4)     [2349](2,5)  [5](2,6)     [13](2,7)    [8](2,8)     
[15679](3,0) [1679](3,1)  [156](3,2)   [25](3,3)    [4](3,4)     [8](3,5)     [3](3,6)     [26](3,7)    [57](3,8)    
[4578](4,0)  [3478](4,1)  [3458](4,2)  [6](4,3)     [57](4,4)    [23](4,5)    [1](4,6)     [28](4,7)    [9](4,8)     
[56789](5,0) [36789](5,1) [2](5,2)     [35](5,3)    [579](5,4)   [1](5,5)     [4](5,6)     [68](5,7)    [57](5,8)    
[147](6,0)   [147](6,1)   [14](6,2)    [8](6,3)     [2](6,4)     [5](6,5)     [6](6,6)     [9](6,7)     [3](6,8)     
[68](7,0)    [368](7,1)   [368](7,2)   [9](7,3)     [1](7,4)     [7](7,5)     [2](7,6)     [5](7,7)     [4](7,8)     
[2](8,0)     [5](8,1)     [9](8,2)     [4](8,3)     [3](8,4)     [6](8,5)     [8](8,6)     [7](8,7)     [1](8,8)     
------------------------------
result
have won at depth 2
------------------------------
[3](0,0) [1](0,1) [8](0,2) [2](0,3) [5](0,4) [9](0,5) [7](0,6) [4](0,7) [6](0,8) 
[5](1,0) [6](1,1) [7](1,2) [1](1,3) [8](1,4) [4](1,5) [9](1,6) [3](1,7) [2](1,8) 
[9](2,0) [2](2,1) [4](2,2) [7](2,3) [6](2,4) [3](2,5) [5](2,6) [1](2,7) [8](2,8) 
[1](3,0) [9](3,1) [6](3,2) [5](3,3) [4](3,4) [8](3,5) [3](3,6) [2](3,7) [7](3,8) 
[4](4,0) [3](4,1) [5](4,2) [6](4,3) [7](4,4) [2](4,5) [1](4,6) [8](4,7) [9](4,8) 
[8](5,0) [7](5,1) [2](5,2) [3](5,3) [9](5,4) [1](5,5) [4](5,6) [6](5,7) [5](5,8) 
[7](6,0) [4](6,1) [1](6,2) [8](6,3) [2](6,4) [5](6,5) [6](6,6) [9](6,7) [3](6,8) 
[6](7,0) [8](7,1) [3](7,2) [9](7,3) [1](7,4) [7](7,5) [2](7,6) [5](7,7) [4](7,8) 
[2](8,0) [5](8,1) [9](8,2) [4](8,3) [3](8,4) [6](8,5) [8](8,6) [7](8,7) [1](8,8) 
------------------------------
Examined: 3 States
Created: 2 States

Nonogram

An example puzzle:
A random state along the way:
-------------------------------------------------------------------------------------------
Got a new assignment:Assignment (1,8, ) from:Singleton
Depth: 45, 56 CSP.Variables Undetermined, state before assignment:
-------------------------------------------------------------
             rows: 10 columns: 10 undetermined: 56
       Considered: 0 Generated: 0 Guessed: 0
    Prop(0):44 Prop(1):25 Prop(2):46 Prop(3):44
Edges:1 Stagger:39 Shorten:12 Full:0 TrimSpace:0 TrimFull:0 Room:0
-------------------------------------------------------------
          |10   8   7   0   4   4   5   6   9  10  
          | 0   2   3  10   6   6   5   4   1   0  
----------+----------------------------------------
          | 0   1   2   3   4   5   6   7   8   9  
----------+----------------------------------------
 9 | 1 | 0|             ####                         | 0| 
   |   | 0|             ####                         | 0| [3-3,1]
 9 | 1 | 1|             ####                 ---     | 1| 
   |   | 1|             ####                |??|     | 1| [3-3,1]
 8 | 2 | 2|      #-- #--#### #-- #-- #-- #-- #--     | 2| 
   |   | 2|     |??||??|####|??||??||??||??||??|     | 2| [2-4,2]
 7 | 3 | 3|      #-- #--#### #-- #-- #-- #-- #--     | 3| [2-6,5]
   |   | 3|     |??||??|####|??||??||??||??||??|     | 3| [1-5,1][3-8,2]
 5 | 5 | 4|      #-- #--#### #-- #-- #-- #-- #--     | 4| 
   |   | 4|     |??||??|####|??||??||??||??||??|     | 4| [1-7,5]
 6 | 4 | 5|      #-- #--#### #-- #-- #-- #-- #--     | 5| 
   |   | 5|     |??||??|####|??||??||??||??||??|     | 5| [1-6,4]
 5 | 5 | 6|      #-- #--#### #-- #-- #-- #-- #--     | 6| 
   |   | 6|     |??||??|####|??||??||??||??||??|     | 6| [1-7,5]
 5 | 5 | 7|      #-- #--#### #-- #-- #-- #-- #--     | 7| 
   |   | 7|     |??||??|####|??||??||??||??||??|     | 7| [1-7,5]
 4 | 6 | 8|      #-- #--######## #-- #-- #-- #--     | 8| 
   |   | 8|     |??||??|########|??||??||??||??|     | 8| [1-8,6]
 5 | 5 | 9|      #-- #--#### #-- #-- #-- #-- #--     | 9| [4-5,2]
   |   | 9|     |??||??|####|??||??||??||??||??|     | 9| [2-4,2][5-8,3]
----------+----------------------------------------
          | 0   1   2   3   4   5   6   7   8   9  
--------------------------------------------------
          |     #B2 #B2 #B0 #B3 #B2 #B2 #B2 #B1     
          |     #E9 #E5 #E9 #E9 #E9 #E9 #E9 #E9     
          |     #S2 #S1 #S10#S6 #S6 #S5 #S4 #S1     
          | ----------------------------------------
          |          B3                             
          |          E6                             
          |          S4                             
          | ----------------------------------------
          |         #B4                             
          |         #E7                             
          |         #S1                             
          | ----------------------------------------
          |          B5                             
          |          E8                             
          |          S4                             
          | ----------------------------------------
          |         #B6                             
          |         #E9                             
          |         #S1                             
          | ----------------------------------------
          |                                         
          |                                         
          |                                         
          | ----------------------------------------
----------+----------------------------------------

The final, solved, state:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
          Solution Considered:1 Generated:1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-------------------------------------------------------------
             rows: 10 columns: 10 undetermined: 0
       Considered: 1 Generated: 1 Guessed: 0
    Prop(0):74 Prop(1):37 Prop(2):63 Prop(3):75
Edges:6 Stagger:47 Shorten:15 Full:1 TrimSpace:8 TrimFull:6 Room:2
-------------------------------------------------------------
          |10   8   7   0   4   4   5   6   9  10  
          | 0   2   3  10   6   6   5   4   1   0  
----------+----------------------------------------
          | 0   1   2   3   4   5   6   7   8   9  
----------+----------------------------------------
 9 | 1 | 0|             ####                         | 0| 
   |   | 0|             ####                         | 0| [3-3,1]
 9 | 1 | 1|             ####                         | 1| 
   |   | 1|             ####                         | 1| [3-3,1]
 8 | 2 | 2|         ########                         | 2| 
   |   | 2|         ########                         | 2| [2-3,2]
 7 | 3 | 3|     ####    ########                     | 3| [2-2,1]
   |   | 3|     ####    ########                     | 3| [1-1,1][3-4,2]
 5 | 5 | 4|     ####################                 | 4| 
   |   | 4|     ####################                 | 4| [1-5,5]
 6 | 4 | 5|             ################             | 5| 
   |   | 5|             ################             | 5| [3-6,4]
 5 | 5 | 6|             ####################         | 6| 
   |   | 6|             ####################         | 6| [3-7,5]
 5 | 5 | 7|             ####################         | 7| 
   |   | 7|             ####################         | 7| [3-7,5]
 4 | 6 | 8|             ########################     | 8| 
   |   | 8|             ########################     | 8| [3-8,6]
 5 | 5 | 9|         ########    ############         | 9| [4-4,1]
   |   | 9|         ########    ############         | 9| [2-3,2][5-7,3]
----------+----------------------------------------
          | 0   1   2   3   4   5   6   7   8   9  
--------------------------------------------------
          |     #B3 #B2 #B0 #B3 #B4 #B5 #B6 #B8     
          |     #E4 #E2 #E9 #E8 #E9 #E9 #E9 #E8     
          |     #S2 #S1 #S10#S6 #S6 #S5 #S4 #S1     
          | ----------------------------------------
          |          B3                             
          |          E3                             
          |          S1                             
          | ----------------------------------------
          |         #B4                             
          |         #E4                             
          |         #S1                             
          | ----------------------------------------
          |          B5                             
          |          E8                             
          |          S4                             
          | ----------------------------------------
          |         #B9                             
          |         #E9                             
          |         #S1                             
          | ----------------------------------------
          |                                         
          |                                         
          |                                         
          | ----------------------------------------
----------+----------------------------------------

Cryptography

En-/De-cryption implementations.

Hacknet

Reimplimentation of the crypto-scheme in the computer game Hacknet.

Enigma Machine

Implementation of the WWII rotor-based Enigma crypto-machines. Supports any number of encrypting rotors, with pre-defined defaults for the popular M4 (Navy), M3 (Army) models. Support for a plugboard substitution layer.

Various En-/De-cryptors

Implementation of various popular crypto algorithms:

Downloaders

Youtube

Download videos from youtube.

Twitch

Download VODs or streams from twitch.

Full Site

Recursively download a site. Follow all linked documents at the path level or below. Parse HTML, CSS, JS for links. Localize documents so the downloaded-files link to the downloaded, local files, not the original remote files.

Misc Video Games

A few video games I made.

Planetary Simulator

60 Hour Game

Assignment 6