From 49855133de9077c22bb466f76720c36e4ba9e776 Mon Sep 17 00:00:00 2001
From: Refik Hadzialic
Date: Wed, 5 Oct 2011 17:49:59 +0200
Subject: Report writing in progress!

---
 notFinishedCode/Report/test.tex | 72 +++++++++++++++++++++++++++++++----------
 1 file changed, 55 insertions(+), 17 deletions(-)

(limited to 'notFinishedCode/Report/test.tex')

diff --git a/notFinishedCode/Report/test.tex b/notFinishedCode/Report/test.tex
index 7bfd079..c4cbed6 100644
--- a/notFinishedCode/Report/test.tex
+++ b/notFinishedCode/Report/test.tex
@@ -40,13 +40,13 @@
 %DEFINE THE STUFF FOR CODE 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \lstset{ %
-language=Python,                % choose the language of the code
+%language=Python,                % choose the language of the code
 columns=fullflexible,
 keywordstyle=\color[rgb]{0.608,0.561,0.008},
 commentstyle=\color[rgb]{0.25,0.5,0.35},
 stringstyle=\color[rgb]{0.25,0.35,0.85},
 basicstyle=\footnotesize,%\scriptsize       % the size of the fonts that are used for the code
-numbers=left,                   % where to put the line-numbers
+%numbers=left,                   % where to put the line-numbers
 numberstyle=\footnotesize,      % the size of the fonts that are used for the line-numbers
 stepnumber=1,                   % the step between two line-numbers. If it is 1 each line will be numbered
 numbersep=8pt,                  % how far the line-numbers are from the code
@@ -108,6 +108,11 @@ Gradually we implemented a bit-by-bit of the final software. Every single step w
 \subsection{Usage}         % subsection 2.1.1
 \newpage
 \section{Design}
+\begin{figure}[hb!]
+  \centering
+  \includegraphics[width=130mm]{bb.jpg}
+  \caption[]{BeagleBoard, a linux-on-chip board where our controller software runs the GSM device }
+\end{figure}
 \newpage
 \section{Protocol}
 
@@ -130,29 +135,59 @@ Gradually we implemented a bit-by-bit of the final software. Every single step w
 \end{figure}
 
 %\newpage
-\section{Encryption of data}
+\section{Security and safety of the test system}
+\Large Safety and security of the software plays a major role in our project. 
+It is of vital importance that only as few as possible people have access to our test system since the resulting data could be exploited to plan an attack 
+(e.g. assume the University alarm system uses the SIP gateway to connect to the outside world and to alarm the police, if one knows that the SIP gateway is not working properly, a burglar could plan to rob the University building just at that moment.) Therefore the choice to go Open Source is justified due to the fact that one should know how every single detail of the system works.
+All the time, while we were working on the project, we were made aware of this issue by Denis and Konrad.  
+We decided to use asymmetric key cryptography, where each side has two keys (private and public.) In the next sections we will explain in more details how we applied the methods.
+\subsection{Encryption of the communication channels}
+At first we thoought to encrypt the data before sending them but since none of us was an expert on encryption standards the idea was rejected. Alongside the fact that none of us had been an expert in the field of cryptography, we were not experts in the field of internet programming either. One could find maybe a way to disable our server software with various hacking methods (e.g. 
+trying to open the port until the system runs out of memory and in our case the system which we used on the server side was a BeagleBoard with ARM architecture running on a single chip TI OMAP processor, refer to the picture on figure 1.) 
+We had to eliminate even the slightest possible threat in return for spending more time for debugging the test software system. Despite we were aware of all these facts, we had to choose one of the plenty implemented encryption standards on Linux.
+Denis and Konrad suggested using the SSH Tunneling method. Using the SSH Tunneling method we could hide the real port we use for our socket connection on the other hand we could force the socket to accept only local connections (i.e. from the machine where the handler software was running.) 
+The first problem we faced was that SSH required a username and password, everytime we created an SSH Tunnel. We could avoid this problem by copying the public key from our server (where our test software runs) to the BeagleBoard \cite{sshTunnel}. 
+This can be performed by executing the following commands in the terminal shell.
+One has to create first the private and public keys on the local machine(i.e. server machine, where the test software runs):
+
 \begin{lstlisting}
-import subprocess
-import string
+jsmith@local-host$ [Note: You are on local-host here]
+
+jsmith@local-host$ ssh-keygen
+Generating public/private rsa key pair.
+Enter file in which to save the key (/home/jsmith/.ssh/id_rsa):[Enter key]
+Enter passphrase (empty for no passphrase): [Press enter key]
+Enter same passphrase again: [Pess enter key]
+Your identification has been saved in /home/jsmith/.ssh/id_rsa.
+Your public key has been saved in /home/jsmith/.ssh/id_rsa.pub.
+The key fingerprint is:
+33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9 jsmith@local-host
+\end{lstlisting}
+
+Then one needs to copy the public key to the remote machine (BeagleBoard) using ssh-copy-id:
 
-class Ping:
+\begin{lstlisting}
+jsmith@local-host$ ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
+jsmith@remote-host's password:
+Now try logging into the machine, with "ssh 'remote-host'", and check in:
 
-        def __init__(self, pingAddress):
-                self.pingAddress = pingAddress
+.ssh/authorized_keys
 
-        def ping(self,numberTries):
-                tried = 1
-                while numberTries >= tried:
-                        tried += 1
-                        #the parameter c 1 means only one ping to be sent, parameter W 3 means how many seconds the time out should be, 3 seconds
-                        ping_cmd = subprocess.Popen(['ping', self.pingAddress, '-c', '1', '-W', '2'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0]
-b
-                        pingAlive = int(string.find(ping_cmd, '1 received'))
-                        unknownHost = int(string.find(ping_cmd, 'unknown host'))
+to make sure we haven't added extra keys that you weren't expecting. 
+\end{lstlisting}
 
+After we have created the public and private keys, and coppied the public key on the machine to which we want to connect, we can test if we can make an SSH connection to the remote machine:
 
+\begin{lstlisting}
+jsmith@local-host$ ssh remote-host
+Last login: Sun Nov 16 17:22:33 2008 from 192.168.1.2
+[Note: SSH did not ask for password.]
 
+jsmith@remote-host$ [Note: You are on remote-host here]
 \end{lstlisting}
+
+
+
 \newpage
 \section{Web page}
 
@@ -172,6 +207,9 @@ b
 \bibitem{site1} H. Simpson, \emph{Proof of the Riemann
 Hypothesis},  preprint (2003), available at 
 \url{http://www.math.drofnats.edu/riemann.ps}.
+ 
+\bibitem{sshTunnel} R. Natarajan, \emph{3 Steps to perform SSH login without password using ssh-keygen \& ssh-copy-id},  accessed on 18.08.2011, available at 
+\url{http://goo.gl/fX68N}.
 
 %bibliography end
 \end{thebibliography}
-- 
cgit v1.2.3-55-g7522

