initial commit of essay

Benedikt Kristinsson 7 years ago
parent fe94fbe554
commit 8827862beb
  1. 10
  2. 67
  3. BIN
  4. 307

.gitignore vendored

@ -1,5 +1,15 @@
# Latex
# emacs
# Byte-compiled / optimized / DLL files

@ -0,0 +1,67 @@
% Stuff from ardrand left as example
author = {Gary Anthes},
title = {{The Quest for Randomness}},
journal = {{CACM}},
year = {2011},
volume = {54},
pages = {13-15},
number = {4},
file = {anthes2011.pdf:anthes2011.pdf:PDF},
keywords = {random number generation},
timestamp = {2011.04.30}
author = {Satoshi Nakamoto},
title = {{Bitcoin: A Peer-to-Peer Electronic Cash System}},
year = {2008},
file = {bitcoin.pdf:bitcoin.pdf:PDF},
keywords = {random number generation},
timestamp = {2008.10.31}
author = "Mozilla Project",
title = "Mozilla CA Program Overview",
howpublished = {\url{}},
note = {Accessed: Feb 2015}
author = "Mozilla Project",
title = "Mozilla CA Certificate Policy",
howpublished = {\url{}},
note = {Accessed: Feb 2015}
author = "Benedikt Kristinsson",
title = {benediktkr/ncpoc on GitHub},
howpublished = {\url{}},
note = {Accessed: \today}
author = {{Zvi Gutterman, Benny Pinkas, Tzachy Reinman}},
title = {{Analysis of the Linux Random Number Generator}},
journal = {{Security and Privacy}},
pages = {385-400},
year = "2006",
timestamp = "2011.12.05"
title = {Applied Cryptography},
year = {1996},
author = {Bruce Schneier},
edition = "second edition",
owner = {kristjan},
publisher = {John wiley \& Sons},
timestamp = {2010.09.20}

Binary file not shown.

@ -0,0 +1,307 @@
\documentclass[a4paper]{article} % Switch to report for front page
\usepackage{setspace} % Allows more fine-grained control over line spacing
\usepackage{fancyhdr} % Headers and footers
\usepackage{lastpage} % Allows references to the last page of the document
\usepackage{chngpage} % Change format mid-page ?
\usepackage{soul} % Highlights text, with \hl{}
\usepackage[usenames,dvipsnames]{color} % Add color to text
\usepackage{ifthen} % \ifthenelse{}
\usepackage{courier} % Write in a monospace font
%\usepackage{geometry} % Because 'fullpage' is outdated
\newcommand{\Title}{A proof-of-concept implementation}
\newcommand{\SubTitle}{A distributed peer-to-peer ledger for trust in HTTPS}
\newcommand{\DueDate}{\today} % Or \today
\newcommand{\AuthorClearSpace}{3in} % How far below the title the author name shoudl appear
\newcommand{\AuthorName}{Benedikt Kristinsson}
\newcommand{\DueLang}{} % Icelandic (perhaps some ifelse on language pack)
%\newcommand{\DueLang}{Due on} % English
% This is the color used for comments below
%frame=single, % Single frame around code
%basicstyle=\small\ttfamily, % Use small true type font
basicstyle=\small, % Don't use ttf
keywordstyle=[1]\color{Blue}, %\bf % functions green (bold commented out)
keywordstyle=[2]\color{Green}, % function arguments purple
keywordstyle=[3]\color{Red}\underbar, % User functions underlined and blue
stringstyle=\color{MyDarkGreen}, % Strings
showstringspaces=false, % Don't put marks in string spaces
% To add more keywords
% Function parameters
%morekeywords=[2]{on, off, interp},
%%% Put user defined functions here
%morekeywords=[3]{FindESS, homework_example},
%morecomment=[l][\color{Grey}]{...}, % Line continuation (...) like blue comment
%numbers=left, % Line numbers on left
%firstnumber=1, % Line numbers start with line 1
%numberstyle=\tiny\color{Grey}, % Line numbers are blue
%stepnumber=1 % Line numbers go in steps of 1
% Setup the header and footer
%\pagestyle{fancy} % Pagestyle allows for header/foother
\pagestyle{plain} % No header/footerer
% \rfoot{Page\ \thepage\ of\ \protect\pageref{LastPage}}
% This is used to trace down (pin point) problems in latexing a document:
% Some tools
% Includes a figure
% The first parameter is the label, which is also the name of the figure
% with or without the extension (e.g., .eps, .fig, .png, .gif, etc.)
% IF NO EXTENSION IS GIVEN, LaTeX will look for the most appropriate one.
% The second parameter is the width of the figure normalized to column width
% (e.g. 0.5 for half a column, 0.75 for 75% of the column)
% The third parameter is the caption.
% Requires \usepackage{graphicx}
%%% I think \captionwidth (see above) can go away as long as
%%% \centering is above
% Includes code
% The first parameter is the label, which also is the name of the script
% with the file extension the '#1' in the command belove
% The second parameter is the optional caption.
\equal{#2}{*} % I have to be oddly specific here
\tmpsection{\sc{#2} }
{\tmpsection{\sc{#1} } }
\Class:\ \Title
\date{\small{\DueLang\ \DueDate}}
\author{\AuthorName\\Advisor: \ClassInstructor\\}
% Uncomment the \tableofcontents and \newpage lines to get a Contents page
% Uncomment the \setcounter line as well if you do NOT want subsections
% listed in Contents
% Remeber to compile twice
%x\section{Lausn verkefnis og útfærsla}
Traditionally we have come to rely on Certificate Authroities (CA)
to verify that the servers we connect to are the ones we are relly
trying to connect to. The CA system is very centralized and more
based on beurocracy than technology.
In this essay we propose a distributed and peer-to-peer techonology
that is builds a distributed consent of what encryption keys a
client should expect a remote server to use. Rather than having to
trust one central authority to tell the truth, the network forms a
majority that is trusted.
% Motivation
% Example of how to write code in this template
The current CA model is broken. \\
Operating systems and browsers come pre-loaded with CA certificates
and will blindly trust their signatures. One rouge CA being
distributed in such a way would make dragnet attacks almost trivial,
and begs the question of wether they have been used for targetted
attacks. In a post-Snowden world, we have to consider these to be
facts, rather than mere speculations. \\
The contributions of this work are the following:
\item An implementation of a peer-to-peer network with Python and Twisted
\section{Vendor-shipped CA certificates}
The CA model instills trusts by having Certificates Authorities sign
certificates. For the operating system or browser to be able to verify
this signature, they need to maintain a list of known CA certificates,
called \textit{root certificates}. These lists come pre-shipped with
the software and are thus hard to maintain and keep up-to-date. \\
If any of these root certificates have signed a certificate for any
given domain, the software will accept the signature as valid and,
more importantly - that the remote server is who it claims to be. If a
state-level actor has control over just one of the root certificates
distributed (hereby referred to be as a \textit{rouge certificate})
then they can man-in-the-middle the connection
trivially. Occasionally, there have been doubts about the legitimacy
of some of these certificates\footnote{dig up examples} and the
Chinese government has at least one broadly distributed
certificate. \\
Mozilla Project publishes their CA Certificate
Policy~\cite{mozillacapolicy} which details the application process,
as well as how Mozilla maintains trust in the root certificates. More
detailed discussion is mainted on the Mozilla
Wiki~\cite{mozillacawiki}, including lists of current CA certificates
as well as a list of all removed CA certificates (although it does not
detail the reasons for the removal).\\
%Microsoft Trusted Root Certificate, published program requirements\footnote{} and there are some Membership Lists\footnote{\%20Root\%20Certificate\%20Program\%20Members\%20-\%20Sept\%202014.pdf} as PDFs on Microsoft Download.\\
\section{Protocol description}
NameChain is a peer-to-peer network to validate certificates with a
majority consensus protocol. It is heavily influenced by the structure
of Bitcoin~\cite{bitcoin2008}. As the proof-of-concept implemenation
is not stable software and might be worked on after the finalization
this essay, the protocol might change. Readers are directed towards
the project on GitHub~\cite{ncpocgithub} for an up-to-date protocol
description. Best effors are made to keep the \texttt{} file
for the project accuarte, but ultimately the protocol is specified by
the sorce code. \\
\section{Proof-of-concept implementation}
The proof-of-concept implemenation is written in Python and uses
Twisted\footnote{\url{}} to implement the
protocol and peer-to-peer network. The code is hosted and maintained
on GitHub~\cite{ncpocgithub}. Messages are serialized to JSON-strings
before being sent over the network, wrapped in an JSON envelope with a
HMAC signature. \\
\begin{lstlisting}[caption=JSON envelope structure]
def make_envelope(msgtype, msg, nodeid):
msg['nodeid'] = nodeid
msg['nonce'] = nonce()
sign =, json.dumps(msg))
envelope = {'data': msg,
'sign': sign.hexdigest(),
'msgtype': msgtype}
return json.dumps(envelope)
Seeing as this is a personal research PoC implementation, broad public
use is not anticipated. The author currently maintains bootstrapping
nodes at \texttt{} and \texttt{}, with
no guarantee of uptime.
%\section{Case study: pre-loaded CA certificates}
%\subsection{Firefox nightly}
%\subsection{Windows 7}
% Stuff to mention
% Switching from 9600 baudrate to the new one resulting in leastsignrand passing poker test
% Also resulted in SerialException
% How closely the algs miss the FIPS test
% Bitrates in 9600 vs new one
% Check other baudrates?
% Eftir að gera
%% Sýna graf frá einum Arduino þar sem lesið er frá öllum pinnum
%% Athgua hvort að ard3 sýni drop á skógarbraut. Taka gröf úr ard2 líka. Skoða ard1
%% Sýna munin á gildum í mismuandi herbergjum (fossahvarf vs skógarbraut)
% Athugasemdir til Ýmis:
%% Mig vantar að orða tengsl við Tsense einhversstaðar
%%% Tsense notaði einmitt aðferðina að lesa analogRead til að búa seed, koma því að
%% Eiga öll NIST security levels erindi í skýrsluna?
%% Ég set footnote á randomSeed referencið í introduction en myndi líka að þurfa að vitna í það í seinni kafla. Hvernig geri ég það snyrtilegast?