added red frames.
authorJan Vales <jan@jvales.net>
Sat, 16 Jan 2016 23:37:10 +0000 (00:37 +0100)
committerJan Vales <jan@jvales.net>
Sat, 16 Jan 2016 23:42:07 +0000 (00:42 +0100)
report/content/exercise1.tex
report/main.tex

index b4847f1f37bae1a5d743b92df0414f41af037518..5640c2068c364977250fc444ea7fc27def6ddafa 100644 (file)
@@ -90,42 +90,42 @@ The message was \emph{\textbf{Starting transmission from Ministry of Cyber {\ucr
 By applying a corrective timing difference of 0.05 we can fully decode the message: \emph{\textbf{Starting transmission from Ministry of Cyber affairs. (Agent Scott)Startin}}\\
 
 Final py-code
-\begin{scriptsize}\begin{verbatim}
-#!/usr/bin/env python                                                                                                                                            
-                                                                                                                                                                
-import csv                                                                                                                                                       
-import binascii                                                                                                                                                  
-                                                                                                                                                                 
-def somedecode(filename):                                                                                                                                        
-  with open(filename, 'rb') as csvfile:                                                                                                                          
-    spamreader = csv.reader(csvfile, delimiter=',', quotechar='"')                                                                                               
-    header = last = None                                                                                                                                         
-    ln = 0                                                                                                                                                       
-    v = ""                                                                                                                                                       
-                                                                                                                                                                 
-    for row in spamreader:                                                                                                                                       
-      if header is None:                                                                                                                                         
-        header = row                                                                                                                                             
-        continue                                                                                                                                                 
-      if last is None:                                                                                                                                           
-        last = row                                                                                                                                               
-        continue                                                                                                                                                 
-                                                                                                                                                                 
-      va = str(int((float(row[1])-float(last[1])-0.05)*10))                                                                                                      
-      if va not in ["0","1"]:                                                                                                                                    
-        va = "1"                                                                                                                                                 
-                                                                                                                                                                 
-      v = v+va                                                                                                                                                   
-      ln += 1                                                                                                                                                    
-      if ln == 8:                                                                                                                                                
-        print binascii.unhexlify('%x' % int(v, 2)),                                                                                                                      
-        v = ""                                                                                                                                                   
-        ln = 0                                                                                                                                                   
-      last = row                                                                                                                                                 
-                                                                                                                                                                 
-if __name__ == "__main__":                                                                                                                                       
-    somedecode("filtered.dehexed.csv")                                                                                                                           
-\end{verbatim}\end{scriptsize}
+\begin{redframe}\begin{scriptsize}\begin{verbatim}
+#!/usr/bin/env python
+
+import csv
+import binascii
+
+def somedecode(filename):
+  with open(filename, 'rb') as csvfile:
+    spamreader = csv.reader(csvfile, delimiter=',', quotechar='"')
+    header = last = None
+    ln = 0
+    v = ""
+
+    for row in spamreader:
+      if header is None:
+        header = row
+        continue
+      if last is None:
+        last = row
+        continue
+
+      va = str(int((float(row[1])-float(last[1])-0.05)*10))
+      if va not in ["0","1"]:
+        va = "1"
+
+      v = v+va
+      ln += 1
+      if ln == 8:
+        print binascii.unhexlify('%x' % int(v, 2)),
+        v = ""
+        ln = 0
+      last = row
+
+if __name__ == "__main__":
+    somedecode("filtered.dehexed.csv")
+\end{verbatim}\end{scriptsize}\end{redframe}
 
 
 \subsection{Rep:1.i}
@@ -233,32 +233,32 @@ Write in the report the decoded message. Explain clearly how you carried out the
 
 \emph{\textbf{Agent South already successfully infiltrated The minister's office. In the next step, we try to acquire data from the Ministry of Cyber Affair's office network. Stay tuned, I will keep you updated on the progress. (This message was sent by agent Scott)Agent South already successfully infiltrated The minister's office. In the next step, we try to acquire data from the Ministry of Cyber Affair's office network. Stay tuned, I will keep you updated on t}}\\
 
-code\\
-\begin{verbatim}
-#!/usr/bin/env python                                                                                                                                               
-                                                                                                                                                                    
-import csv                                                                                                                                                          
-import binascii                                                                                                                                                     
-                                                                                                                                                                    
-def somedecode(filename):                                                                                                                                           
-  with open(filename, 'rb') as csvfile:                                                                                                                             
-    spamreader = csv.reader(csvfile, delimiter=',', quotechar='"')                                                                                                  
-    header = None                                                                                                                                                   
-    bits = ""                                                                                                                                                       
-                                                                                                                                                                    
-    for row in spamreader:                                                                                                                                          
-      if header is None:                                                                                                                                            
-        header = row                                                                                                                                                
-        continue                                                                                                                                                    
-                                                                                                                                                                    
-      if row[2] == '192.168.67.81':                                                                                                                                 
-        bits += "{0:06b}".format(int(row[7]))                                                                                                                         
-                                                                                                                                                                    
-    print binascii.unhexlify('%x' % int(bits, 2))                                                                                                                   
-                                                                                                                                                                    
-if __name__ == "__main__":                                                                                                                                          
-    somedecode("transmission.csv")                                                                                                                                  
-\end{verbatim}
+Final py-code
+\begin{redframe}\begin{scriptsize}\begin{verbatim}
+#!/usr/bin/env python
+
+import csv
+import binascii
+
+def somedecode(filename):
+  with open(filename, 'rb') as csvfile:
+    spamreader = csv.reader(csvfile, delimiter=',', quotechar='"')
+    header = None
+    bits = ""
+
+    for row in spamreader:
+      if header is None:
+        header = row
+        continue
+
+      if row[2] == '192.168.67.81':
+        bits += "{0:06b}".format(int(row[7]))
+
+    print binascii.unhexlify('%x' % int(bits, 2))
+
+if __name__ == "__main__":
+    somedecode("transmission.csv")
+\end{verbatim}\end{scriptsize}\end{redframe}
 
 
 \subsection{Rep:1.p}
index 0f2a5c3122cdbf284486c550fe6cc3730abfa6c4..9b84e1d44453d594ee6294b7f50c43edeb054897 100644 (file)
@@ -92,8 +92,9 @@
 \DeclareUnicodeCharacter{20AC}{\euro}
 
 % frames
-\usepackage[framemethod=default]{mdframed}
-\newmdenv[linecolor=red,backgroundcolor=yellow]{yellowframe}
+\usepackage[framemethod=tikz]{mdframed}
+\newmdenv[linecolor=red]{redframe}
+\newmdenv[linecolor=black]{blackframe}
 
 % quotes
 \usepackage[babel,german=quotes]{csquotes}