Projects


Integrating io_uring with Async to speed up file IO in OCaml

In this article we integrate io_uring into the OCaml Async library. We find that the biggest advantage in OCaml integration is the removal of costly thread pooling and demonstrate an 85% improvement in performance of an IO heavy workload. We provide an open source prototype for further exploration.

More info
Tags: Projects, OCaml Created on: 21-08-2021

Puffer: Privacy Protection & Ad-blocking for Android

Puffer is a novel whole system privacy protector & ad-blocker for Android that outperforms existing DNS based solutions through inspection of Server Name Indication (SNI) records during initialization of TLS connections. Our solution cannot be circumvented with custom DNS resolvers or other common circumvention approaches because we inspect connections at the packet level. As such, our approach still works out of the box with browsers that use custom DNS approaches like Firefox. It also works to stop advertising in apps from circumventing ad-blockers.

More info
Tags: Projects, Privacy Created on: 16-08-2021

Mimic

An open source Gameboy emulator written in Rust that can use a command line interface as a screen and input device. The project is an attempt to make an approachable emulator for the Gameboy that can be used to explain the concepts required in emulating a system without overwhelming the reader. The core logic is all in safe Rust, there is no JIT recompiler, and screen / IO logic is kept separate from the emulation core to reduce complexity. As such, it does not perform ideally, but the Gameboy is an old system so ideal performance is not necessary to run games at full speed.

More info
Tags: Projects, Emulators Created on: 16-08-2021

Parrot - Lightweight functional static website generation

Parrot is an opinionated static website generator written in Ocaml. A static website is a website that requires no application server, it is just a series of HTML pages served by a HTTP file server with no special application logic. Parrot creates a static website from a series of markdown articles and a website template, producing a website artifact that can be deployed to almost any HTTP server. The website template does not need to include any JavaScript or CSS dependencies, and is particularly well suited to lightweight blog generation. Parrot is used to create my personal website.

More info
Tags: Projects, Web Created on: 14-08-2021

CHIP-9

This project implements as CHIP-8 emulator / interpreter in Rust and use the CLI and the input and output device, allowing you to play CHIP-8 games on the command line. The emulator is written in Rust with a custom emulation core and uses the console_engine library for IO.

More info
Tags: Projects, Emulators Created on: 14-08-2021

Simplifying endianness sensitive file parsers in Rust with Omnom

Recently, while creating a TIFF decoder in Rust ran into a frequent issue in parser legibility - endianness. Typically, a file format will specify an endianness globally through it's specification, or will include a marker in it's header to indicate the endianness with which the file was saved. Usually, at this point a parser devolves into a series of scalar type and endianness specific calls, such as 'htons', or custom conversion functions like 'read_u32_le', which can reduce legibility and makes implementations more error prone. This pattern is also difficult to work with in file formats where both endiannesses are permitted, such as TIFF, where endianness is selected based on values read from the header. In this article we introduce an abstraction in Rust which leans on type-inference to abstract away scalar type specific functions when parsing data from a stream.

More info
Tags: Projects Created on: 09-01-2021

Writing your own JSON parser in Haskell

JSON (JavaScript object notation) is a ubiquitous text-based data format. To load JSON data into a program you need a JSON parser, a piece of code that reads the text JSON data and converts it into data structures that can be directly used by the program. In this article we walk through creating a JSON parser from scratch in Haskell.

More info
Tags: Projects Created on: 18-12-2020

How to speed up long-distance HTTP file downloads by 6x

The vast majority of HTTP communications use the TCP protocol to transfer data. TCP connections deliver data in-order and without message loss through the use of retransmits and message buffers. Since buffers need to store all sent messages before they are acknowledged, the maximum achievable throughput of a TCP connection is calculatable by a function of buffer size and latency. In long distance communications, this maximum throughput is often lower than the line speed, slowing down the connection on a line that could support faster communications. In this article we explore what impact these buffers have on TCP connection throughput in Linux for HTTP file downloads, demonstrating performance improvements of up to 6x over Ubuntu defaults on a connection with a 200ms ping.

More info
Tags: Projects, Web, Networking Created on: 10-12-2020

How to build and use a custom Linux kernel

In this short article we cover how to clone a copy of the Linux source code and how to install alongside your distribution default.

More info
Tags: Projects Created on: 09-12-2020

ExpoSE: A Quick Start Guide

In this tutorial I explain how to use the ExpoSE dynamic symbolic execution (DSE) tool. First I run through how to use ExpoSE with some simple JavaScript test-cases and then explain how to interpret the results.

More info
Tags: Tutorials, ExpoSE, JavaScript, Projects Created on: 10-08-2018

How to Instrument JavaScript in Chromium

When analyzing JavaScript software it is common to rewrite or instrument the program in some way in order to expose specific data during execution. Typically instrumentation of JavaScript in the browser is achieved by a proxy - a tool that rewrites JavaScript in network requests. In practice proxies typically do not perform well as there are often multiple entry points to a program and it can be hard to correctly rewrite all cases. Another alternative is modifying V8 to achieve the desired level of program instrumentation. Unfortunately, modern JavaScript interpreters are complex pieces of software and this often carries heavy technical and maintenance overheads. Instead we propose rewriting the JavaScript entry point within a browser to instrument source code, achieving a reasonable compromise between maintainability and development time. In this tutorial we are going to modify V8, the JavaScript interpreter used by Chromium, so that all JavaScript executed by Chromium can be rewritten by an instrumentation framework.

More info
Tags: JavaScript, Tutorials, Chromium, Projects Created on: 09-08-2018

A Short Tutorial on Logging in ExpoSE

The concurrent execution of test-cases and JavaScript compilation process can make logging test-case output confusing in ExpoSE. In this short tutorial I explain how to enable test-case logging and give quick configurations.

More info
Tags: ExpoSE, Tutorials, JavaScript, Projects Created on: 09-08-2018

ExpoSE: Practical Symbolic Execution Of Standalone JavaScript

JavaScript has evolved into a versatile ecosystem for not just the web, but also a wide range of server-side and client-side applications. With this increased scope, the potential impact of bugs increases. Despite this, testing tools for JavaScript have remained relatively primitive, largely due to the languages complex implementation and confusing specification.

ExpoSE is a dynamic symbolic execution (DSE) tool for JavaScript with support for asynchronous events, strings, and complex regular expressions (including capture groups). It also supports concurrent test-case execution and provides detailed coverage statistics.

More info
Tags: Projects, Research, Papers Created on: 09-08-2018

Z3JavaScript - Native Z3 Bindings for Node.js

Before we can symbolically execute JavaScript we need a way to invoke an SMT solver directly from JavaScript, however we found that there is almost no existing language support for Node.js. To remedy this we developed Z3JavaScript, an NPM-installable set of bindings to the popular SMT solver Z3. In addition to a set of primitive bindings we provide a set of wrapper classes to simplify usage from JavaScript. We also provide a regular expression rewriter which allows for reasoning about regular expressions, capture groups, and backreferences in programs.

More info
Tags: Projects Created on: 09-08-2018

Detecting Humanity - Brave Software

One unresolved problem with the web is the detection of bots, programs that drive a web browser to emulate human behavior. Bot detection is an issue in web development because automated tools can reduce the user experience, such as a bot which responds to Twitter posts with angry messages. During a research internship as Brave, a privacy-focused web browser, we worked on a new client-side approach to detect user humanity.

More info
Tags: Work, Research, Projects Created on: 09-08-2018

A Solution To Compression Oracles on the Web - Cloudflare

Compression is often considered an essential tool when reducing the bandwidth usage of internet services. The impact that the use of such compression schemes can have on security, however, has often been overlooked. The recently detailed CRIME, BREACH, TIME and HEIST attacks on TLS have shown that if an attacker can make requests on behalf of a user then secret information can be extracted from encrypted messages using only the length of the response. Deciding whether an element of a web-page should be secret often depends on the content of the page, however there are some common elements of web-pages which should always remain secret such as Cross-Site Request Forgery (CSRF) tokens. Such tokens are used to ensure that malicious webpages cannot forge requests from a user by enforcing that any request must contain a secret token included in a previous response.

More info
Tags: Work, Research, Projects Created on: 09-08-2018

PhD - Information Security Group - Royal Holloway, University of London

I began a PhD with the Information Security Group (ISG) at Royal Holloway in September 2015 as part of the Cyber Security CDT. The CDT is set to take 4 years to complete during which I will be exposed to a wide variety of topics relating to the security of computing devices such as static and dynamic program analysis, cryptography, and network security.

More info
Tags: Work, Projects Created on: 09-08-2018

Dawn - x86 Operating System

Dawn is a x86 based operating system (OS) with a process scheduler, virtual memory manager, application loader, a defined set of system calls and a host of other features. This project was undertaken as part of an optional A-level module. The project involved development of a operating system kernel and a set of utility programs, as well as the design of a set of tools designed for the OS which allow the user to interact and perform tasks. The code was primarily written in C (C99), with small amounts of assembly used in the Kernel, as well as some bash or python scripts to automate compilation and deployment of the OS.

More info
Tags: Projects Created on: 09-08-2018

Kiniro - Android Game & Engine

Kiniro is a game (and accompanying game-engine) from developed from scratch. For this work I created a 2.5D platforming game engine compatible with Linux, Mac OS X, and Android. The engine is entirely written in C++ and includes support for physics through a homebrew physics engine, sound through OpenAL, and large 2D animations.

More info
Tags: Projects, Games Created on: 09-08-2018

Scribble - Interpreted, Garbage Collected, Programming Language

Scribble is a garbage collected programming language with a reference implementation including a full compiler, intermediate representation and reference virtual machine. The language was designed to make extending existing C++ applications easier and to enable users to extend a programs functionality, increasing the usefulness of a piece of software. The implementation also attempts to reduce the likelihood of security issues by allowing developers to strictly control what functionality the virtual machine exposes to the end user through a simple interface, allowing them to control what access the scripts will have to the host platform.

More info
Tags: Projects Created on: 09-08-2018

LJIT - LISP Language with JIT

As a recent hobby project I have been working to improve my knowledge of ahead-of-time (AOT) and just-in-time (JIT) compilers. To that end I developed a new LISP style language with a AOT compiler. The project was developed in C++ and includes a LL(1) parser, a AST structure and a AST -> Machine code JIT converter. The resulting language is a simple integer only language which supports recursion and function arguments.

More info
Tags: Projects, Programming Languages Created on: 09-08-2018