Beruflich Dokumente
Kultur Dokumente
Introduction to Computer
Security
Tom Chothia
Ciphers
Frequency analysis
One Time Pads
AES
A framework for
thinking about
computer security
A Threat/Attacker Model
What are we trying to keep our assets
safe from?
Before building a security system you
must state your assumption about what
the attacker might try.
Attackers
Lone Hackers, script
kiddies.
Probably run known attacks
using scripts.
Professional Criminal
gangs:
Take control of 100,000s
of computers via bugs in
web-browsers
Spam, phishing attacks.
DoS attacks
VM based exercises
Governments:
Unbelievable computing
power
Wiretaps
Lawyers
Insiders.
Lab Sessions
From week 2, on Wednesday from
10-12 there will be a lab session.
Web Page
http://www.cs.bham.ac.uk/internal/courses/comp-sec/
Lecture slides.
Live Demos
These lectures will include lots of live
demos.
All live demos are risky, some will go
wrong, e.g.,
Dropped network connections
Crashed program.
Exercises.
A Facebook group for questions and discussion:
IntroCompSec2015
https://www.facebook.com/groups/1538774439706261/
Further reading.
Codes vs Cipher
What is 27 in binary?
a) 00011011
b) 0010 0111
c) 00110010 00110111
d) 00100111
e) All of the above.
Hex
0 = 0000
1 = 0001
2 = 0010
3 = 0011
4 = 0100
5 = 0101
6 = 0110
7 = 0111
8 = 1000
9 = 1001
A = 1010
B = 1011
C = 1100
D = 1101
E = 1110
F = 1111
Characters 0 to F
encode 4 bits.
Easiest way to write
down binary as text.
27 = 0010 0111
Base64
Caesar Cipher
Shortest way
to write binary
as printable
characters.
Common for
keys & crypto
This module
will use hex
Using a Key
Using a Key
Frequency Analysis
While hard to break by brute force,
replacing each letter with another is
easy to break using frequency analysis.
Frequency analysis counts the number
of times
each symbol occurs
each pair of symbols
etc.
Frequency Analysis
Message: HELLOALICE
Key:
SGFKPQYEIJ
Cipher text: ALRWERKNLO
Cipher Text
picture for wikipedia GNU
Perfect encryption
Needs a key as long as the message.
XOR/add the key and the message:
Perfect encryption
Needs a key as long as the message.
XOR/add the key and the message:
(M
Xor
k) k
=M
0 xor 0 = 0
1 xor 0 = 1
0 xor 1 = 1
1 xor 1 = 0
ascii
Hello Alice
Key
11001011 01001101 11110001
Block Ciphers
Modern ciphers work on blocks of plain text,
not just a single symbol.
They are made up of a series of
permutations and substitutions repeated
on each block.
The key controls the exact nature of the
permutations and substitutions.
Modulo Arithmetic
Arithmetic modulo n means that you count
up to n-1 then loop back to 0
i.e., 0,1,2,...,n-1,0,1,2,...,n-1,0,1,2,...
a mod b = r
for largest whole number k
such that a = b.k + r
Advanced Encryption
Standard ( AES )
AES is a state-of-the-art block cipher.
It works on blocks of 128-bits.
It generates 10 round keys from a single 128bit key.
In uses one permutation: ShiftRows and three
substitutions SubBytes, MixColumns,
AddRoundKey.
SubBytes: S-box
a0,0 a0,1 a0,2 a0,3
ShiftRows
a0,0 a0,1 a0,2 a0,3
a1,0 a1,1 a1,2 a1,3
a2,0 a2,1 a2,2 a2,3
a3,0 a3,1 a3,2 a3,3
no change
1 to the left
2 to the left
3 to the left
MixColumn
b0,0 a
a
b0,1 a
b0,2 a
b0,3
b1,1
a
b1,2
b1,3
b1,0
1,0 a
1,1 a
1,2 a
1,3
b2,2
a
b2,3
b2,0
b2,1
2,0 a
2,1 a
2,2 a
2,3
b2,0 b2,1 b
b2,2
2,2 b2,3
b3,3
a
b3,0
b3,1
b3,2
3,0 a
3,1 a
3,2 a
3,3
a3,0 a3,1 a
a3,3
3,2
b3,0 b3,1 b
b3,2 b3,3
3,2
AddRoundKey
a0,0 a0,1 a0,2 a0,3
AddRoundKey xors the block with the 128bit round key (which was generated from the
main key).
bi,j = ai,j xor ki,j
AES
SubBytes
ShiftRows
MixColumns
AddRoundKey
Finally:
1. SubBytes
2. ShiftRows
3. AddRoundKey
Tomorrows Lecture:
Modern Block Ciphers
AES, DES and 3-DES