Lecture#1 Merged
Lecture#1 Merged
Higher ROI
Information Security is
like brakes in a race car.
Wait, What?
(perfect vs.
Imperfect) (Full vs.
(Instantaneous vs.
Partial satisfaction) Durative)
Goals
(Deterministic vs.
Stochastic)
Database &
Big Data
Objectives
Introducevarious security topics
Whirlwind tour of various security topics
Learning
Lectures,questions, discussions
Guest lectures (if possible)
Evaluation
Exams
Assignments/quizzes/Homeworks
CIA Model
Security protocols
Identity management
Cryptography
Economics of Information Security
Information hiding and watermarking techniques
Privacy
Buffer Overflow
Blockchain/Digital Currency
Topics to be covered
21
Network Security
ACL Mechanism
Threat Modeling
Security Testing
Critical infrastructure protection
Ethical hacking
…
Post conditions for the course
22
Assignments: 15%
Quizzes: 10%
Exams: 35%
Mid-term: 15%
Final: 20%
Project: 35%
Participation/discussions: 5% ☺
Google classroom
Please register yourself here ASAP
We expect you to post at least one question or answer
one question or make a comment, etc. once a week
Remember, there is some data to show that students who
do well on these online discussion forums are some who
understand or have understood the topics well
Administrativia
29
Course Website:
Google Classroom code: gi7roxd
Class Schedule:
Time: M Th 0930-1100hrs
Class Venue: Old Acad C21
Website: http://faculty.iiitd.ac.in/~arunb/
Teaching Assistants:
To be Announced
31
Thank you
CSE345/545 - Winter 2025
Foundations of Computer Security
Lecture 1: Security Components
Dan,
2
the admin
Alice’s view of Security
3
Implementation
People
Physical security
Everything in between
National governments
Terrorists
Thieves
Business competitors
Your supplier
Your consumer
New York Times
Your family members (parents, children)
Your friends
Your ex-friends
Vulnerabilities
16
Authentication
Authentication
20
(A, C, F, L, S)
A information that proves identity
C information stored on computer and used to validate
authentication information
F complementation function; f : A → C
Sequence of characters
Examples: 10 digits, a string of letters, etc.
Generated randomly, by user, by computer with user input
Sequence of words
Examples: pass-phrases
Algorithms
Examples: challenge-response, one-time passwords
Entropy vs. memorability
The more complex a password the harder it is to guess ...
... and the harder it is to remember.
Thus, we write them down.
Storage
23
Store as cleartext
If password file compromised, all passwords revealed
Encipher file
Need to have decipherment, encipherment keys in memory
Reduces to previous problem
Social Engineering
Password Resetting – surprisingly large!
Generation mechanisms
Time-synchronization
Challenge-response
◼ Using a challenge from server
◼ Example: Let cn be the current challenge from server,
f(cn) = pn The passwords p in the order of use are
p1, p2 … pn
Hash chain
◼ Using a chain of hash functions
◼ Example: h is the one-way hash function, p is the OTP and an
initial seed s
h(s)=p1, h(p1)=p2, …, h(pn-1)=pn
The passwords in the order of use are
pn, pn-1, …, p2, p1
Challenge-Response
28
Token-based
Used to compute response to challenge
◼ May encipher or hash challenge
◼ May require PIN from user
Temporally-based
Every minute (or so) different number shown
◼ Computer knows what number to expect when
User enters number and fixed password
Biometrics
30
User 1 R, W, O R R, W, X, O W
User 2 R R, O R R, W, X, O
Access Control List
37
Authentication
Given a process that wishes to perform an operation on an object
◼ ACL needs to authenticate the process’s identity
◼ Capabilities do not require authentication, but require unforgeability
Least Privilege
Capabilities provide finer grained least privilege control
Revocation
ACL can remove a group of users from the list, and those users can
no longer gain access to the object
Capabilities have no equivalent operation
TROJAN HORSES
ACL
A:r
File F
A:w
B:r
File G
A:w
Principal A ACL
executes
A:r
read File F
Program Goodies A:w
Trojan Horse
B:r
File G
write A:w
Subjects Objects
Top Secret Read OK Top Secret
Secret Secret
Unclassified Unclassified
Access Control: Bell-LaPadula
Subjects Objects
Top Secret Top Secret
Unclassified Unclassified
Access Control: Bell-LaPadula
Subjects Objects
Top Secret Top Secret
Secret Secret
* property (star):
the no write-down (NWD) property
Whilea subject has read access to object O, the subject can
only write to object P if
C(O) ≤ C (P)
No process may write data to a lower level
Access Control: Bell-LaPadula
Subjects Objects
Top Secret Write OK Top Secret
Secret Secret
Unclassified Unclassified
Access Control: Bell-LaPadula
Subjects Objects
Top Secret Top Secret
Unclassified Unclassified
Access Control: Bell-LaPadula
Subjects Objects
Top Secret Top Secret
Secret Secret
users roles
permissions (P)
(U) (R) Permission
User Assignment (UA)
Assignment (PA)
RBAC Family
RBAC1 RBAC2
role hierarchy constraints
58
RBAC Family (cont.)
59
Thanks to PK, Kohno, Kurose, Ross and others for sample slides and materials
Cryptography
1
Classical ciphers
Mono-alphabetic: Letters of the plaintext alphabet are
mapped into other unique letters
Poly-alphabetic: Letters of the plaintext alphabet are
mapped into letters of the ciphertext space depending
on their positions in the text
Substitution
5
a b c d e f g h i j k l m n o p q r s t u v w x y z
q e r y u i o p a s d f g w h j k l z x c v b n m t
Plaintext: under attack we need help
Ciphertext: cwyul qxxqrd bu wuuy pufj
[from Stallings, Cryptography & Network Security]
6
Transposition
7
Plain text: I a t t a c k
Key: 2342342 (key is “234”)
Cipher text: K d x v d g m
Problem of Vigenere Cipher
7-9
Hash Functions
No keys
Symmetric Key Cryptography
11
Blocks of
plaintext
Padding
16
DES operation
initial permutation
16 identical “rounds” of
function application,
each using different 48
bits of key
final permutation
The Advanced Encryption Standard (AES)
19
In 1997, the U.S. National Institute for Standards and Technology (NIST)
put out a public call for a replacement to DES.
It narrowed down the list of submissions to five finalists, and ultimately
chose an algorithm that is now known as the Advanced Encryption
Standard (AES).
AES is a block cipher that operates on 128-bit blocks. It is designed to
be used with keys that are 128, 192, or 256 bits long, yielding ciphers
known as AES-128, AES-192, and AES-256.
20
Weakness:
Strengths:
Documents and images are not
Is very simple suitable for ECB encryption since
Allows for parallel patters in the plaintext are
encryptions of the blocks repeated in the ciphertext:
of a plaintext
Can tolerate the loss or
damage of a block
Cipher Block Chaining (CBC) Mode
24
In Cipher Block Chaining (CBC) Mode
The previous ciphertext block is combined with the
current plaintext block C[i] = EK (C[i −1] P[i])
C[−1] = V, a random block separately transmitted
encrypted (known as the initialization vector)
Decryption: P[i] = C[i −1] DK (C[i])
CBC Encryption: CBC Decryption:
P[0] P[1] P[2] P[3] P[0] P[1] P[2] P[3]
V
V
EK EK EK EK DK DK DK DK
Strengths: Weaknesses:
Doesn’t show patterns in CBC requires the reliable
the plaintext transmission of all the
Is the most common mode
blocks sequentially
Is fast and relatively
CBC is not suitable for
simple
applications that allow
packet losses (e.g., music
and video streaming)
Stream Cipher
26
Key stream
Pseudo-random sequence of bits S = S[0], S[1], S[2], …
Can be generated on-line one bit (or byte) at the time
Stream cipher
XOR the plaintext with the key stream C[i] = S[i] P[i]
Suitable for plaintext of arbitrary length generated on the fly, e.g., media
stream
Synchronous stream cipher
Key stream obtained only from the secret key K
◼ Independent with plaintext and ciphertext
Works for high-error channels if plaintext has packets with sequence numbers
Sender and receiver must synchronize in using key stream
If a digit is corrupted in transmission, only a single digit in the plaintext is
affected and the error does not propagate to other parts of the message.
Stream Cipher
27
RC4
Designed in 1987 by Ron Rivest for RSA Security
Trade secret until 1994
Uses keys with up to 2,048 bits
Simple algorithm
Block cipher in counter mode (CTR)
Use a block cipher with block size b
The secret key is a pair (K,t), where K is key and t (counter) is a b-
bit value
The key stream is the concatenation of ciphertexts
EK (t), EK (t + 1), EK (t + 2), …
Can use a shorter counter concatenated with a random value
Synchronous stream cipher
Hash Functions
29
IV || || || || digest
SHA-1
Hashing Time MD5
0.06
0.05
0.04
msec
0.03
0.02
0.01
0
0 100 200 300 400 500 600 700 800 900 1000
Input Size (Bytes)
Cryptographic Hash Lifecycle
35
http://valerieaurora.org/hash.html
[via http://www.schneier.com/blog/archives/2011/06/the_life_cycle.html]
Birthday Attack
36
The brute-force birthday attack aims at finding a collision for a hash function h
Randomly generate a sequence of plaintexts X1, X2, X3,…
For each Xi compute yi = h(Xi) and test whether yi = yj for some j < i
Stop as soon as a collision has been found
If there are m possible hash values, the probability that the i-th plaintext does not collide
with any of the previous i −1 plaintexts is 1 − (i − 1)/m
The probability Fk that the attack fails (no collisions) after k plaintexts is
Fk = (1 − 1/m) (1 − 2/m) (1 − 3/m) … (1 − (k − 1)/m)
Using the standard approximation 1 − x e−x
Fk e−(1/m + 2/m + 3/m + … + (k−1)/m) = e−k(k−1)/2m
The attack succeeds/fails with probability ½ when Fk = ½ , that is,
e−k(k−1)/2m = ½
k 1.17 m½
We conclude that a hash function with b-bit values provides about b/2 bits of security
Public Key Cryptography
37
+ Bob’s public
K
B key
- Bob’s private
K
B key
Prime number p:
p is an integer
p2
The only divisors of p are 1 and p
Examples
2, 7, 19 are primes
−3, 0, 1, 6 are not primes
Prime decomposition of a positive integer n:
n = p1e1 … pkek
Example:
200 = 23 52
Fundamental Theorem of Arithmetic
The prime decomposition of a positive integer is unique
Greatest Common Divisor
40
Magic d
m = (m e mod n) mod n
happens!
c
RSA example:
45
letter m me c = me mod n
encrypt:
l 12 1524832 17
d
decrypt:
c c m = cd mod n letter
17 481968572106750915091411825223071697 12 l
Computational extensive
RSA: Why is that m = (m e mod n)
d
mod n
e
(m mod n) d mod n = medmod n
ed mod (p-1)(q-1)
= m mod n
(using number theory result above)
1
= m mod n
(since we chose ed to be divisible by
(p-1)(q-1) with remainder 1 )
= m
RSA: another important property
7-47
Setup: Example
n = pq, with p and q primes ◼ Setup:
e relatively prime to p = 7, q = 17
(n) = (p − 1) (q − 1) n = 717 = 119
d inverse of e in Z(n) (n) = 616 = 96
◼ ed mod z = 1 e=5
Keys: d = 77
Public key: KE = (n, e) ◼ Keys:
Private key: KD = d public key: (119, 5)
private key: 77
Encryption:
◼ Encryption:
Plaintext M in Zn
M = 19
C = Me mod n C = 195 mod 119 = 66
Decryption: ◼ Decryption:
M = Cd mod n C = 6677 mod 119 = 19
Digital Signatures
49
Asymmetry:
Signature can only be generated by owner/knower of private key
Signature can be verified by anyone via public key
Non-repudiation:
Sender cannot prove message (signature) was not sent
Key may have been stolen
Public Key Distribution and Authentication
50
Efficiency
Publickey cryptographic algorithms are orders of magnitude
slower than symmetric key algorithms
Hybrid model
Public
key used to establish temporary shared key
Symmetric key used for remainder of communication
Computational Security
52
⚫ What to hide
⚫ Texts
⚫ Images
⚫ Sound
⚫ ……
⚫ How to hide
– embed text in text/images/audio/video files
– embed image in text/images/audio/video files
– embed sound in text/images/audio/video files
A Real Steganographic Example
59
During WWI the following cipher message was
actually sent by a German spy
“Apparently neutral’s protest is thoroughly discounted
and ignored. Isman hard hit. Blockade issue affects
pretext for embargo on by-products, ejecting suets and
vegetable oils”
Hidden Message
“Pershingsails from NY June 1”
How to extract the hidden message from the sent
message?
A Steganographic System
60
CSE345/545 - Winter 2025
Network Basics and Security Concerns
Example: FEDC:BA98:7654:3210:FEDC:BA98:7654:3210
Abbreviations:
actual: 1080:0000:0000:0000:0008:0800:200C:417A
skip 0’s: 1080:0:0:0:8:800:200C:417A
Authentication attacks
TCP Sequence Number Prediction
11
source spoofing
replay packets • DOS attacks
no data integrity or • Replay attacks
• Spying
confidentiality • and more…
Fundamental Issue:
Networks are not (and will never be)
fully secure
Goals of IPSec
16
Insecure
IPSec Architecture
17
ESP AH
IKE
Transport Mode
Router Router
Tunnel Mode
IPSec
19
IP header
Next Payload
Reserved
header length
Authentication Data
How It Works
21
Firewalls
Firewalls
23
Application level
Threats to collection/transmission of large quantities of personal data
Applications, such as research involving population studies, electronic
commerce, distance learning
Communication level
Threats to anonymity of sender / forwarder / receiver
Threats to anonymity of service provider
Threats to privacy of communication, such as via monitoring / logging
of transactional data: Extraction of user profiles & its long-term
storage
System level
For example, threats due to attacks on system in order to gain access
to its data
Audit trails
Threats to Privacy (cont.)
9
Identity theft – the most serious crime against privacy
Aggregation and data mining
Poor system security
Government threats
◼ Taxes / homeland security / etc.
◼ People’s privacy vs. homeland security concerns
The Internet as privacy threat
◼ Unencrypted e-mail/web surfing/attacks
Corporate rights and private business
◼ Companies may collect certain data
Privacy for sale - many traps
◼ “Free” is not free, such as frequent-buyer cards reducing your
privacy
Privacy Practices in E-Commerce
10
◼ Essential notifications
◼ Identification of the entity collecting the data
◼ Identification of the uses to which the data will be put
◼ Identification of any potential recipients of the data
◼ The nature of the data collected and the means by which
it is collected
◼ Whether the provision of the requested data is voluntary
or required, and the consequences of a refusal to provide
the requested information
◼ The steps taken by the data collector to ensure the
confidentiality, integrity and quality of the data
Privacy Practices in E-Commerce (cont.)
12
2. Choice/consent
◼ Websites must give consumers options as to how any
personal information collected from them may be
used
◼ Two traditional types of choice/consent
◼ Opt-in requires affirmative steps by the consumers
to allow the collection and/or use of information
◼ Opt-out requires affirmative steps to disallow the
collection and/or use of such information.
Privacy Practices in E-Commerce (cont.)
13
3. Access/participation
◼ User would be able to review, correct, and in some cases
delete personal information on a particular website.
◼ Access must encompass
◼ timely and inexpensive access to data
◼ simple means for contesting inaccurate or incomplete
data
◼ mechanism by which the data collector can verify the
information
◼ means by which corrections and/or consumer objections
can be added to the data file and sent to all data
recipients.
Privacy Practices in E-Commerce (cont.)
14
4. Security/integrity
◼Websites must use both managerial and
technical measures to protect against
loss and the unauthorized access,
destruction, use, or disclosure of the
data.
Privacy Practices in E-Commerce (cont.)
15
5. Enforcement/Redress
◼ Mechanisms to enforce all above privacy principles.
◼ Self-Regulation: Mechanisms to ensure compliance
(enforcement) and appropriate means of recourse by
injured parties (redress).
◼ Private Remedies: A statutory scheme could create
private rights of action for consumers harmed by an
entity's unfair information practices .
◼ Government Enforcement: Civil or criminal penalties
enforced by governments.
A Case Study
16
Thanks to Norcie, Newman, Shambuddho and others for sample slides and materials
Who Needs Anonymity?
1
Corporations:
Hiding collaborations of sensitive business units or partners
Hide procurement suppliers or patterns
Competitive analysis
Who Needs Anonymity?
2
You:
Where are you sending email (who is emailing you)
What web sites are you browsing
Where do you work, where are you from
What do you buy, what kind of physicians do you visit, what books do
you read, ...
Governments
Open source intelligence gathering
◼ Hiding individual analysts is not enough
◼ That a query was from a govt. source may be sensitive
Defense in depth on open and classified networks
◼ Networks with only cleared users (but a million of them)
Dynamic and semi-trusted international coalitions
◼ Network can be shared without revealing existence or amount of
communication between all parties
Anonymous From Whom?
Adversary Model
3
https://tor.eff.org
How to enforce anonymity
5/53
What is Tor?
Sender/Responder anonymity network
Circuit-based overlay network
Low-latency
2nd gen aims:
◼Perfect forward secrecy, congestion control,
directory servers, integrity checking, location
hidden servers...
Overlay Networks
7
Basic Tor ideas
8
TOR choose the path for each new circuit before it builds it.
The exit node is chosen first, followed by the other nodes in the
circuit
Some of the constraints:
Exit relay should actually allows you to exit the Tor network
◼ Some only allow web traffic (port 80) which is not useful when someone
wants to send emails
The exit relay has to have available capacities
No same router twice for the same path.
No choosing any router in the same family as another in the same
path. (Two routers are in the same family if each one lists the
other in the "family" entries of its descriptor)
No choosing more than one router in a given /16 subnet.
The first node must be a Guard node.
Overview of Tor
10/53
Tor client
Middleman
If entry/exit points
collude, they know
that I and R are
using Tor. Can
conduct timing
analysis to try and
link I/R
De-anonymization
12/53
Services
Users
Proxies
The 3 Traditional Threats to Tor's Security:
• DNS Leaks
• Traffic Analysis
• Malicious Exit Nodes
Threat 1: DNS Leaks
Exit
Middleman Node
Colluding
Entry Server
Tor Node
client Injected
pattern
LinkWidth
Probes
Adversary
NetFlow Based Traffic Analysis: Approach
Non-victim Benign
Tor network server
Injected
Injected Entry traffic pattern travels Injected
traffic pattern through the victim circuit traffic
pattern
Middleman
Exit
NetFlow Data
Victim
NetFlow Data
Colluding
server
21/53
Dan Egerstad Interview: (One of first to widely publish on malicious exit nodes):
http://www.smh.com.au/news/security/the-hack-of-the-
year/2007/11/12/1194766589522.html?page=fullpage#contentSwap1