Security
Amir H. Payberah
amir@sics.se
Amirkabir University of Technology
(Tehran Polytechnic)
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 1 / 61
The Security Problem
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 2 / 61
Security
Protection is strictly an internal problem.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 3 / 61
Security
Protection is strictly an internal problem.
• How do we provide controlled access to programs and data stored in
a computer system?
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 3 / 61
Security
Protection is strictly an internal problem.
• How do we provide controlled access to programs and data stored in
a computer system?
Security requires both protection system and the consideration of
the external environment within which the system operates.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 3 / 61
The Security Problem
A system is secure if its resources are used and accessed as intended
under all circumstances.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 4 / 61
The Security Problem
A system is secure if its resources are used and accessed as intended
under all circumstances.
Threat is potential security violation.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 4 / 61
The Security Problem
A system is secure if its resources are used and accessed as intended
under all circumstances.
Threat is potential security violation.
Attack is attempt to breach security: accidental or malicious.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 4 / 61
The Security Problem
A system is secure if its resources are used and accessed as intended
under all circumstances.
Threat is potential security violation.
Attack is attempt to breach security: accidental or malicious.
Easier to protect against accidental than malicious misuse
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 4 / 61
Security Violation Categories
Breach of confidentiality: unauthorized reading of data
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 5 / 61
Security Violation Categories
Breach of confidentiality: unauthorized reading of data
Breach of integrity: unauthorized modification of data
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 5 / 61
Security Violation Categories
Breach of confidentiality: unauthorized reading of data
Breach of integrity: unauthorized modification of data
Breach of availability: unauthorized destruction of data
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 5 / 61
Security Violation Categories
Breach of confidentiality: unauthorized reading of data
Breach of integrity: unauthorized modification of data
Breach of availability: unauthorized destruction of data
Theft of service: unauthorized use of resources
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 5 / 61
Security Violation Categories
Breach of confidentiality: unauthorized reading of data
Breach of integrity: unauthorized modification of data
Breach of availability: unauthorized destruction of data
Theft of service: unauthorized use of resources
Denial of Service (DoS): prevention of legitimate use
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 5 / 61
Security Violation Methods
Masquerading (breach authentication): pretending to be an autho-
rized user to escalate privileges
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 6 / 61
Security Violation Methods
Masquerading (breach authentication): pretending to be an autho-
rized user to escalate privileges
Replay attack: repeat a valid data transmission
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 6 / 61
Security Violation Methods
Masquerading (breach authentication): pretending to be an autho-
rized user to escalate privileges
Replay attack: repeat a valid data transmission
Man-in-the-middle attack: intruder sits in data flow, masquerading
as sender to receiver and vice versa
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 6 / 61
Security Violation Methods
Masquerading (breach authentication): pretending to be an autho-
rized user to escalate privileges
Replay attack: repeat a valid data transmission
Man-in-the-middle attack: intruder sits in data flow, masquerading
as sender to receiver and vice versa
Session hijacking: intercept an already-established session to bypass
authentication
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 6 / 61
Standard Security Attacks
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 7 / 61
Security Measure Levels
Security must occur at four levels to be effective:
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 8 / 61
Security Measure Levels
Security must occur at four levels to be effective:
• Physical: data centers, servers, connected terminals
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 8 / 61
Security Measure Levels
Security must occur at four levels to be effective:
• Physical: data centers, servers, connected terminals
• Human: only appropriate users have access to the system
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 8 / 61
Security Measure Levels
Security must occur at four levels to be effective:
• Physical: data centers, servers, connected terminals
• Human: only appropriate users have access to the system
• OS: protection mechanisms, debugging
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 8 / 61
Security Measure Levels
Security must occur at four levels to be effective:
• Physical: data centers, servers, connected terminals
• Human: only appropriate users have access to the system
• OS: protection mechanisms, debugging
• Network: intercepted communications, interruption, DOS
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 8 / 61
Program Threats
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 9 / 61
Program Threats
Many variations, many names
• Trojan horse
• Trap door
• Logic bomb
• Stack and buffer flow
• Viruses
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 10 / 61
Trojan Horse
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 11 / 61
Trojan Horse (1/2)
Code segment that misuses its environment.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 12 / 61
Trojan Horse (1/2)
Code segment that misuses its environment.
Exploits mechanisms for allowing programs written by users to be
executed by other users.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 12 / 61
Trojan Horse (1/2)
Code segment that misuses its environment.
Exploits mechanisms for allowing programs written by users to be
executed by other users.
Example:
• A text-editor program has a code to search the file to be edited for
certain keywords.
• If any are found, the entire file may be copied to a special area
accessible to the creator of the text editor.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 12 / 61
Trojan Horse (2/2)
Variation of Trojan horse:
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 13 / 61
Trojan Horse (2/2)
Variation of Trojan horse:
Emulating a login program
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 13 / 61
Trojan Horse (2/2)
Variation of Trojan horse:
Emulating a login program
Spyware: accompanies a program that the user has installed.
• Download ads to display on the user’s system
• Create pop-up browser windows when certain sites are visited
• Capture information from the user’s system and return it to a
central site: covert channel
• Violation of the principle of least privilege.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 13 / 61
Trap Door
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 14 / 61
Trap Door
A hole in the software that only designer of a program is capable of
using.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 15 / 61
Trap Door
A hole in the software that only designer of a program is capable of
using.
Could be included in a compiler.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 15 / 61
Trap Door
A hole in the software that only designer of a program is capable of
using.
Could be included in a compiler.
Difficult to detect: we have to analyze all the source code for all
components of a system.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 15 / 61
Logic Bomb
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 16 / 61
Logic Bomb
Program that initiates a security incident under certain circum-
stances.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 17 / 61
Logic Bomb
Program that initiates a security incident under certain circum-
stances.
Hard to detect: because under normal operations, there would be
no security hole.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 17 / 61
Stack and Buffer Flow
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 18 / 61
Stack and Buffer Overflow (1/6)
The most common way for an attacker to gain unauthorized access
to the target system.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 19 / 61
Stack and Buffer Overflow (1/6)
The most common way for an attacker to gain unauthorized access
to the target system.
The attack exploits a bug in a program.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 19 / 61
Stack and Buffer Overflow (1/6)
The most common way for an attacker to gain unauthorized access
to the target system.
The attack exploits a bug in a program.
• E.g., The programmer neglected to code bounds checking on an
input field.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 19 / 61
Stack and Buffer Overflow (1/6)
The most common way for an attacker to gain unauthorized access
to the target system.
The attack exploits a bug in a program.
• E.g., The programmer neglected to code bounds checking on an
input field.
• The attacker sends more data than the program was expecting.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 19 / 61
Stack and Buffer Overflow (1/6)
The most common way for an attacker to gain unauthorized access
to the target system.
The attack exploits a bug in a program.
• E.g., The programmer neglected to code bounds checking on an
input field.
• The attacker sends more data than the program was expecting.
• The attacker can write a program to do the next page steps.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 19 / 61
Stack and Buffer Overflow (2/6)
1 Overflow an input field, for example, a web-page form expects a
user name, until it writes into the stack.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 20 / 61
Stack and Buffer Overflow (2/6)
1 Overflow an input field, for example, a web-page form expects a
user name, until it writes into the stack.
2 Overwrite the current return address on the stack with the address
of the exploit code loaded in step 3.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 20 / 61
Stack and Buffer Overflow (2/6)
1 Overflow an input field, for example, a web-page form expects a
user name, until it writes into the stack.
2 Overwrite the current return address on the stack with the address
of the exploit code loaded in step 3.
3 Write a simple set of code for the next space in the stack that
includes the commands that the attacker wishes to execute, for
instance, spawn a shell.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 20 / 61
Stack and Buffer Overflow (3/6)
Lack of bounds checking
If the command line input is longer than BUFFER SIZE?
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 21 / 61
Stack and Buffer Overflow (4/6)
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 22 / 61
Stack and Buffer Overflow (4/6)
Automatic variables: variables defined locally to the function.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 22 / 61
Stack and Buffer Overflow (4/6)
Automatic variables: variables defined locally to the function.
Frame pointer: the address of the beginning of the stack frame.
• Can vary during the function call.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 22 / 61
Stack and Buffer Overflow (4/6)
Automatic variables: variables defined locally to the function.
Frame pointer: the address of the beginning of the stack frame.
• Can vary during the function call.
Return address: where to return control once the function exits.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 22 / 61
Stack and Buffer Overflow (5/6)
The cracker could replace the return address with the address of the
code segment containing the attacking program.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 23 / 61
Stack and Buffer Overflow (6/6)
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 24 / 61
Viruses
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 25 / 61
Viruses
Code fragment embedded in legitimate program.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 26 / 61
Viruses
Code fragment embedded in legitimate program.
Self-replicating: designed to infect other computers.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 26 / 61
Viruses
Code fragment embedded in legitimate program.
Self-replicating: designed to infect other computers.
Very specific to CPU architecture, OS, applications.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 26 / 61
Viruses
Code fragment embedded in legitimate program.
Self-replicating: designed to infect other computers.
Very specific to CPU architecture, OS, applications.
Usually borne via email or as a macro.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 26 / 61
Viruses
Code fragment embedded in legitimate program.
Self-replicating: designed to infect other computers.
Very specific to CPU architecture, OS, applications.
Usually borne via email or as a macro.
UNIX and other multiuser OSs generally are not susceptible to
viruses.
• The executable programs are protected from writing by the OS.
• Even if a virus infects such a program, its powers usually are limited
because other aspects of the system are protected.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 26 / 61
Viruses Categories (1/4)
File virus
• Infects a system by appending itself to a file.
• It changes the start of the program so that execution jumps to its
code.
• After it executes, it returns control to the program.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 27 / 61
Viruses Categories (1/4)
File virus
• Infects a system by appending itself to a file.
• It changes the start of the program so that execution jumps to its
code.
• After it executes, it returns control to the program.
Boot virus
• Infects the boot sector of the system, executing every time the system
is booted and before the OS is loaded.
• They are known as memory viruses, because they do not appear in
the file system.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 27 / 61
Viruses Categories (2/4)
Macro virus
• Most viruses are in a low-level languages, e.g., assembly or C.
• Macro viruses are in a high-level language, e.g., Visual Basic.
• For example, a macro virus could be contained in a spreadsheet file.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 28 / 61
Viruses Categories (2/4)
Macro virus
• Most viruses are in a low-level languages, e.g., assembly or C.
• Macro viruses are in a high-level language, e.g., Visual Basic.
• For example, a macro virus could be contained in a spreadsheet file.
Source code virus
• Modifies the source code to include the virus and to help spread the
virus.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 28 / 61
Viruses Categories (2/4)
Macro virus
• Most viruses are in a low-level languages, e.g., assembly or C.
• Macro viruses are in a high-level language, e.g., Visual Basic.
• For example, a macro virus could be contained in a spreadsheet file.
Source code virus
• Modifies the source code to include the virus and to help spread the
virus.
Polymorphic virus
• It changes each time it is installed to avoid detection by anti-virus
software.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 28 / 61
Viruses Categories (3/4)
Encrypted virus
• Includes decryption code along with the encrypted virus, again to
avoid detection.
• The virus first decrypts and then executes.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 29 / 61
Viruses Categories (3/4)
Encrypted virus
• Includes decryption code along with the encrypted virus, again to
avoid detection.
• The virus first decrypts and then executes.
Stealth virus
• It avoids detection by modifying parts of the system that could be
used to detect it.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 29 / 61
Viruses Categories (3/4)
Encrypted virus
• Includes decryption code along with the encrypted virus, again to
avoid detection.
• The virus first decrypts and then executes.
Stealth virus
• It avoids detection by modifying parts of the system that could be
used to detect it.
Tunneling virus
• It bypasses detection by an anti-virus scanner by installing itself in
the interrupt-handler chain.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 29 / 61
Viruses Categories (4/4)
Multipartite virus
• It infects multiple parts of a system, including boot sectors,
memory, and files.
• This makes it difficult to detect and contain.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 30 / 61
Viruses Categories (4/4)
Multipartite virus
• It infects multiple parts of a system, including boot sectors,
memory, and files.
• This makes it difficult to detect and contain.
Armored virus
• It is coded to make it hard for anti-virus researchers to unravel and
understand.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 30 / 61
System and Network Threats
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 31 / 61
System and Network Threats
System and network threats involve the abuse of services and net-
work connections.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 32 / 61
System and Network Threats
System and network threats involve the abuse of services and net-
work connections.
They create a situation in which the OS resources and user files are
misused.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 32 / 61
System and Network Threats
System and network threats involve the abuse of services and net-
work connections.
They create a situation in which the OS resources and user files are
misused.
They include:
• Worms
• Port scanning
• Denial of Service (DoS)
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 32 / 61
Worms (1/2)
An standalone program that replicates itself in order to spread to
other computers.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 33 / 61
Worms (1/2)
An standalone program that replicates itself in order to spread to
other computers.
Often, it uses a computer network to spread itself.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 33 / 61
Worms (1/2)
An standalone program that replicates itself in order to spread to
other computers.
Often, it uses a computer network to spread itself.
Unlike a computer virus, it does not need
to attach itself to an existing program.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 33 / 61
Worms (1/2)
An standalone program that replicates itself in order to spread to
other computers.
Often, it uses a computer network to spread itself.
Unlike a computer virus, it does not need
to attach itself to an existing program.
The Morris worm (the Internet worm) is
the first computer worms distributed via
the Internet: 1988
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 33 / 61
Worms (2/2)
Morris worm: exploited UNIX networking features in rsh and bugs
in finger and sendmail programs.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 34 / 61
Worms (2/2)
Morris worm: exploited UNIX networking features in rsh and bugs
in finger and sendmail programs.
It made up of two programs: a grappling hook program and the
main program.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 34 / 61
Worms (2/2)
Morris worm: exploited UNIX networking features in rsh and bugs
in finger and sendmail programs.
It made up of two programs: a grappling hook program and the
main program.
The grappling hook program uploaded main worm program.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 34 / 61
Port Scanning
A means to detect a system’s vulnerabilities to attack.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 35 / 61
Port Scanning
A means to detect a system’s vulnerabilities to attack.
Automated attempt to connect to a range of ports on IP addresses.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 35 / 61
Port Scanning
A means to detect a system’s vulnerabilities to attack.
Automated attempt to connect to a range of ports on IP addresses.
Detection of answering service protocols, OS and version running
on system.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 35 / 61
Port Scanning
A means to detect a system’s vulnerabilities to attack.
Automated attempt to connect to a range of ports on IP addresses.
Detection of answering service protocols, OS and version running
on system.
nmap scans all ports in a given IP range for a response
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 35 / 61
Port Scanning
A means to detect a system’s vulnerabilities to attack.
Automated attempt to connect to a range of ports on IP addresses.
Detection of answering service protocols, OS and version running
on system.
nmap scans all ports in a given IP range for a response
nessus has a database of protocols and bugs (and exploits) to apply
against a system.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 35 / 61
Denial of Service (DoS)
Overload the targeted computer preventing it from doing any useful
work.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 36 / 61
Denial of Service (DoS)
Overload the targeted computer preventing it from doing any useful
work.
Distributed denial-of-service (DDoS) come from multiple sites at
once.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 36 / 61
Denial of Service (DoS)
Overload the targeted computer preventing it from doing any useful
work.
Distributed denial-of-service (DDoS) come from multiple sites at
once.
Consider traffic to a web site.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 36 / 61
Denial of Service (DoS)
Overload the targeted computer preventing it from doing any useful
work.
Distributed denial-of-service (DDoS) come from multiple sites at
once.
Consider traffic to a web site.
CS students writing bad fork() code.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 36 / 61
Cryptography
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 37 / 61
Cryptography
Cryptography is used to constrain the potential senders and/or re-
ceivers of a message.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 38 / 61
Cryptography
Cryptography is used to constrain the potential senders and/or re-
ceivers of a message.
Based on secrets, called keys.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 38 / 61
Cryptography
Cryptography is used to constrain the potential senders and/or re-
ceivers of a message.
Based on secrets, called keys.
Cryptography enables a recipient of a message to verify that the
message was created by some computer possessing a certain key.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 38 / 61
Cryptography
Cryptography is used to constrain the potential senders and/or re-
ceivers of a message.
Based on secrets, called keys.
Cryptography enables a recipient of a message to verify that the
message was created by some computer possessing a certain key.
Similarly, a sender can encode its message so that only a computer
with a certain key can decode the message.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 38 / 61
Encryption (1/2)
Encryption algorithm consists of:
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
Encryption (1/2)
Encryption algorithm consists of:
Set K of keys
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
Encryption (1/2)
Encryption algorithm consists of:
Set K of keys
Set M of messages
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
Encryption (1/2)
Encryption algorithm consists of:
Set K of keys
Set M of messages
Set C of ciphertexts (encrypted messages)
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
Encryption (1/2)
Encryption algorithm consists of:
Set K of keys
Set M of messages
Set C of ciphertexts (encrypted messages)
A function E : K → (M → C)
• For each k ∈ K, Ek is a function for generating ciphertexts from
messages.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
Encryption (1/2)
Encryption algorithm consists of:
Set K of keys
Set M of messages
Set C of ciphertexts (encrypted messages)
A function E : K → (M → C)
• For each k ∈ K, Ek is a function for generating ciphertexts from
messages.
A function D : K → (C → M)
• For each k ∈ K, Dk is a function for generating messages from
ciphertexts.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
Encryption (2/2)
An encryption algorithm must provide this essential property:
• Given a ciphertext c ∈ C, a computer can compute m such that
Ek (m) = c only if it possesses k.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 40 / 61
Encryption (2/2)
An encryption algorithm must provide this essential property:
• Given a ciphertext c ∈ C, a computer can compute m such that
Ek (m) = c only if it possesses k.
Thus, a computer holding k can decrypt ciphertexts to the plain-
texts.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 40 / 61
Symmetric Encryption
Same key used to encrypt and
decrypt.
• k must be kept secret.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 41 / 61
Symmetric Encryption
Same key used to encrypt and
decrypt.
• k must be kept secret.
E.g., DES, Triple-DES, AES, RC4
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 41 / 61
Asymmetric Encryption
Each user having two keys:
• Public key: published key used to
encrypt data.
• Private key: key known only
to individual user used to decrypt data.
Most common is RSA block cipher.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 42 / 61
Authentication (1/2)
Constraining set of potential senders of a message.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
Authentication (1/2)
Constraining set of potential senders of a message.
This sort of authentication is similar to but distinct from user au-
thentication.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
Authentication (1/2)
Constraining set of potential senders of a message.
This sort of authentication is similar to but distinct from user au-
thentication.
Algorithm components:
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
Authentication (1/2)
Constraining set of potential senders of a message.
This sort of authentication is similar to but distinct from user au-
thentication.
Algorithm components:
• A set K of keys
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
Authentication (1/2)
Constraining set of potential senders of a message.
This sort of authentication is similar to but distinct from user au-
thentication.
Algorithm components:
• A set K of keys
• A set M of messages
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
Authentication (1/2)
Constraining set of potential senders of a message.
This sort of authentication is similar to but distinct from user au-
thentication.
Algorithm components:
• A set K of keys
• A set M of messages
• A set A of authenticators
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
Authentication (1/2)
Constraining set of potential senders of a message.
This sort of authentication is similar to but distinct from user au-
thentication.
Algorithm components:
• A set K of keys
• A set M of messages
• A set A of authenticators
• A function S : K → (M → A): for each k ∈ K, Sk is a function for
generating authenticators from messages.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
Authentication (1/2)
Constraining set of potential senders of a message.
This sort of authentication is similar to but distinct from user au-
thentication.
Algorithm components:
• A set K of keys
• A set M of messages
• A set A of authenticators
• A function S : K → (M → A): for each k ∈ K, Sk is a function for
generating authenticators from messages.
• A function V : K → (M × A → {true, false}): for each k ∈ K,
Vk is a function for verifying authenticators on messages.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
Authentication (2/2)
For a message m, a computer can generate an authenticator a ∈ A
such that Vk(m, a) = true only if it possesses k.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 44 / 61
Authentication (2/2)
For a message m, a computer can generate an authenticator a ∈ A
such that Vk(m, a) = true only if it possesses k.
Thus, computer holding k can generate authenticators on messages
so that any other computer possessing k can verify them.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 44 / 61
Authentication (2/2)
For a message m, a computer can generate an authenticator a ∈ A
such that Vk(m, a) = true only if it possesses k.
Thus, computer holding k can generate authenticators on messages
so that any other computer possessing k can verify them.
Practically, if Vk(m, a) = true then we know m has not been mod-
ified and that send of message has k.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 44 / 61
Authentication - Hash Function (1/2)
Creates small, fixed-size block of data message digest (hash value)
from m.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 45 / 61
Authentication - Hash Function (1/2)
Creates small, fixed-size block of data message digest (hash value)
from m.
Hash Function H must be collision resistant on m.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 45 / 61
Authentication - Hash Function (1/2)
Creates small, fixed-size block of data message digest (hash value)
from m.
Hash Function H must be collision resistant on m.
Must be infeasible to find an m = m such that H(m) = H(m ).
• If H(m) = H(m ), then m = m .
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 45 / 61
Authentication - Hash Function (1/2)
Creates small, fixed-size block of data message digest (hash value)
from m.
Hash Function H must be collision resistant on m.
Must be infeasible to find an m = m such that H(m) = H(m ).
• If H(m) = H(m ), then m = m .
The message has not been modified.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 45 / 61
Authentication - Hash Function (1/2)
Creates small, fixed-size block of data message digest (hash value)
from m.
Hash Function H must be collision resistant on m.
Must be infeasible to find an m = m such that H(m) = H(m ).
• If H(m) = H(m ), then m = m .
The message has not been modified.
E.g., MD5 (128-bit hash), and SHA-1 (160-bit hash)
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 45 / 61
Authentication - Hash Function (2/2)
Not useful as authenticators.
• For example H(m) can be sent with a message.
• But if H is known someone could modify m to m and recompute
H(m ) and modification not detected
• So must authenticate H(m): MAC and digital signature
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 46 / 61
Authentication - MAC
Symmetric encryption used in message-authentication code (MAC)
authentication algorithm.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 47 / 61
Authentication - MAC
Symmetric encryption used in message-authentication code (MAC)
authentication algorithm.
Cryptographic checksum generated from message using secret key.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 47 / 61
Authentication - MAC
Symmetric encryption used in message-authentication code (MAC)
authentication algorithm.
Cryptographic checksum generated from message using secret key.
Note that k is needed to compute both Sk and Vk, so anyone able
to compute one can compute the other end digital signature.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 47 / 61
Authentication - Digital Signature (1/2)
Based on asymmetric keys and digital signature algorithm.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 48 / 61
Authentication - Digital Signature (1/2)
Based on asymmetric keys and digital signature algorithm.
Authenticators produced are digital signatures.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 48 / 61
Authentication - Digital Signature (1/2)
Based on asymmetric keys and digital signature algorithm.
Authenticators produced are digital signatures.
Anyone can verify authenticity of a message.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 48 / 61
Authentication - Digital Signature (1/2)
Based on asymmetric keys and digital signature algorithm.
Authenticators produced are digital signatures.
Anyone can verify authenticity of a message.
In a digital-signature algorithm, computationally infeasible to derive
ks from kv .
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 48 / 61
Authentication - Digital Signature (1/2)
Based on asymmetric keys and digital signature algorithm.
Authenticators produced are digital signatures.
Anyone can verify authenticity of a message.
In a digital-signature algorithm, computationally infeasible to derive
ks from kv .
kv is the public key and ks is the private key.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 48 / 61
Authentication - Digital Signature (2/2)
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 49 / 61
Authentication - Key Distribution
Delivery of a symmetric key is a huge challenge.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
Authentication - Key Distribution
Delivery of a symmetric key is a huge challenge.
• Sometimes done out-of-band, e.g., via a paper document or a
conversation
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
Authentication - Key Distribution
Delivery of a symmetric key is a huge challenge.
• Sometimes done out-of-band, e.g., via a paper document or a
conversation
• If a user wants to communicate with N other users privately: she
needs N keys.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
Authentication - Key Distribution
Delivery of a symmetric key is a huge challenge.
• Sometimes done out-of-band, e.g., via a paper document or a
conversation
• If a user wants to communicate with N other users privately: she
needs N keys.
Asymmetric keys
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
Authentication - Key Distribution
Delivery of a symmetric key is a huge challenge.
• Sometimes done out-of-band, e.g., via a paper document or a
conversation
• If a user wants to communicate with N other users privately: she
needs N keys.
Asymmetric keys
• The keys can be exchanged in public.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
Authentication - Key Distribution
Delivery of a symmetric key is a huge challenge.
• Sometimes done out-of-band, e.g., via a paper document or a
conversation
• If a user wants to communicate with N other users privately: she
needs N keys.
Asymmetric keys
• The keys can be exchanged in public.
• A user needs only one private key, no matter how many other
people she wants to communicate with.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
Authentication - Key Distribution
Delivery of a symmetric key is a huge challenge.
• Sometimes done out-of-band, e.g., via a paper document or a
conversation
• If a user wants to communicate with N other users privately: she
needs N keys.
Asymmetric keys
• The keys can be exchanged in public.
• A user needs only one private key, no matter how many other
people she wants to communicate with.
• Man-in-a-middle attack.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
Authentication - Key Distribution
Delivery of a symmetric key is a huge challenge.
• Sometimes done out-of-band, e.g., via a paper document or a
conversation
• If a user wants to communicate with N other users privately: she
needs N keys.
Asymmetric keys
• The keys can be exchanged in public.
• A user needs only one private key, no matter how many other
people she wants to communicate with.
• Man-in-a-middle attack.
• What we need is a proof of who owns a public key? digital
certificate
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
Authentication - Digital Certificates
Digital certificate is an electronic document used to prove ownership
of a public key.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 51 / 61
Authentication - Digital Certificates
Digital certificate is an electronic document used to prove ownership
of a public key.
It includes information about:
• The key
• Its owner’s identity
• The digital signature of an entity that has verified the certificate’s
contents are correct.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 51 / 61
Authentication - Digital Certificates
Digital certificate is an electronic document used to prove ownership
of a public key.
It includes information about:
• The key
• Its owner’s identity
• The digital signature of an entity that has verified the certificate’s
contents are correct.
Certificate authority are trusted party - their public keys included
with web browser distributions.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 51 / 61
Encryption Example - SSL
Transport Layer Security (TLS) and its predecessor, Secure Sock-
ets Layer (SSL), are cryptographic protocols designed to provide
communication security over the Internet.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 52 / 61
Encryption Example - SSL
Transport Layer Security (TLS) and its predecessor, Secure Sock-
ets Layer (SSL), are cryptographic protocols designed to provide
communication security over the Internet.
Insertion of cryptography at one layer of the ISO network model
(the transport layer).
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 52 / 61
User Authentication
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 53 / 61
User Authentication
Our earlier discussion of authentication involves messages and ses-
sions. But what about users?
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
User Authentication
Our earlier discussion of authentication involves messages and ses-
sions. But what about users?
If a system cannot authenticate a user, then authenticating that a
message came from that user is pointless.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
User Authentication
Our earlier discussion of authentication involves messages and ses-
sions. But what about users?
If a system cannot authenticate a user, then authenticating that a
message came from that user is pointless.
How do we determine whether a users identity is authentic?
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
User Authentication
Our earlier discussion of authentication involves messages and ses-
sions. But what about users?
If a system cannot authenticate a user, then authenticating that a
message came from that user is pointless.
How do we determine whether a users identity is authentic?
• The user’s possession of something (a key or card)
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
User Authentication
Our earlier discussion of authentication involves messages and ses-
sions. But what about users?
If a system cannot authenticate a user, then authenticating that a
message came from that user is pointless.
How do we determine whether a users identity is authentic?
• The user’s possession of something (a key or card)
• The user’s knowledge of something (a user identifier and password)
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
User Authentication
Our earlier discussion of authentication involves messages and ses-
sions. But what about users?
If a system cannot authenticate a user, then authenticating that a
message came from that user is pointless.
How do we determine whether a users identity is authentic?
• The user’s possession of something (a key or card)
• The user’s knowledge of something (a user identifier and password)
• An attribute of the user (fingerprint, retina pattern, or signature)
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
Password
User identity most often established through passwords.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 55 / 61
Password
User identity most often established through passwords.
Encrypt the passwords
• But keep them secret anyway (i.e. Unix uses superuser-only
readable file /etc/shadow)
• Use algorithm easy to compute but difficult to invert.
• Only encrypted password stored, never decrypted.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 55 / 61
Password
User identity most often established through passwords.
Encrypt the passwords
• But keep them secret anyway (i.e. Unix uses superuser-only
readable file /etc/shadow)
• Use algorithm easy to compute but difficult to invert.
• Only encrypted password stored, never decrypted.
One-time passwords
• Use a function based on a seed to compute a password, both user
and computer.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 55 / 61
Implementing Security Defenses
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 56 / 61
Implementing Security Defenses (1/2)
Defense in depth is most common security theory: multiple layers
of security.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 57 / 61
Implementing Security Defenses (1/2)
Defense in depth is most common security theory: multiple layers
of security.
Security policy describes what is being secured.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 57 / 61
Implementing Security Defenses (1/2)
Defense in depth is most common security theory: multiple layers
of security.
Security policy describes what is being secured.
Vulnerability assessment compares real state of a system/network
to the security policy.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 57 / 61
Implementing Security Defenses (1/2)
Defense in depth is most common security theory: multiple layers
of security.
Security policy describes what is being secured.
Vulnerability assessment compares real state of a system/network
to the security policy.
Intrusion detection systems to detect attempted or successful intru-
sions.
• Signature-based detection spots known bad patterns.
• Anomaly detection spots differences from normal behavior.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 57 / 61
Implementing Security Defenses (2/2)
Virus protection
• Searching all programs or programs at execution for known virus
patterns.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 58 / 61
Implementing Security Defenses (2/2)
Virus protection
• Searching all programs or programs at execution for known virus
patterns.
Auditing, accounting, and logging of all or specific system or network
activities.
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 58 / 61
Summary
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 59 / 61
Summary
Security and Protection
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
Summary
Security and Protection
Security violation categories: breach of confidentiality / integrity /
availability, theft of service, and DoS
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
Summary
Security and Protection
Security violation categories: breach of confidentiality / integrity /
availability, theft of service, and DoS
Security violation methods: masquerading, replay attack, man-in-
the-middle, and session hijacking
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
Summary
Security and Protection
Security violation categories: breach of confidentiality / integrity /
availability, theft of service, and DoS
Security violation methods: masquerading, replay attack, man-in-
the-middle, and session hijacking
Program threats: Trojan horse, trap door, logic bomb, stack and
buffer flow, viruses
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
Summary
Security and Protection
Security violation categories: breach of confidentiality / integrity /
availability, theft of service, and DoS
Security violation methods: masquerading, replay attack, man-in-
the-middle, and session hijacking
Program threats: Trojan horse, trap door, logic bomb, stack and
buffer flow, viruses
System and network threats: worms, port scanning, DoS
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
Summary
Security and Protection
Security violation categories: breach of confidentiality / integrity /
availability, theft of service, and DoS
Security violation methods: masquerading, replay attack, man-in-
the-middle, and session hijacking
Program threats: Trojan horse, trap door, logic bomb, stack and
buffer flow, viruses
System and network threats: worms, port scanning, DoS
Cryptography: encryption (symmetric/asymmetric), authentication
(MAC/digital signature), key distribution and digital certificate
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
Summary
Security and Protection
Security violation categories: breach of confidentiality / integrity /
availability, theft of service, and DoS
Security violation methods: masquerading, replay attack, man-in-
the-middle, and session hijacking
Program threats: Trojan horse, trap door, logic bomb, stack and
buffer flow, viruses
System and network threats: worms, port scanning, DoS
Cryptography: encryption (symmetric/asymmetric), authentication
(MAC/digital signature), key distribution and digital certificate
User authentication: password
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
Questions?
Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 61 / 61

Security

  • 1.
    Security Amir H. Payberah amir@sics.se AmirkabirUniversity of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 1 / 61
  • 2.
    The Security Problem AmirH. Payberah (Tehran Polytechnic) Security 1393/9/29 2 / 61
  • 3.
    Security Protection is strictlyan internal problem. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 3 / 61
  • 4.
    Security Protection is strictlyan internal problem. • How do we provide controlled access to programs and data stored in a computer system? Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 3 / 61
  • 5.
    Security Protection is strictlyan internal problem. • How do we provide controlled access to programs and data stored in a computer system? Security requires both protection system and the consideration of the external environment within which the system operates. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 3 / 61
  • 6.
    The Security Problem Asystem is secure if its resources are used and accessed as intended under all circumstances. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 4 / 61
  • 7.
    The Security Problem Asystem is secure if its resources are used and accessed as intended under all circumstances. Threat is potential security violation. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 4 / 61
  • 8.
    The Security Problem Asystem is secure if its resources are used and accessed as intended under all circumstances. Threat is potential security violation. Attack is attempt to breach security: accidental or malicious. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 4 / 61
  • 9.
    The Security Problem Asystem is secure if its resources are used and accessed as intended under all circumstances. Threat is potential security violation. Attack is attempt to breach security: accidental or malicious. Easier to protect against accidental than malicious misuse Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 4 / 61
  • 10.
    Security Violation Categories Breachof confidentiality: unauthorized reading of data Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 5 / 61
  • 11.
    Security Violation Categories Breachof confidentiality: unauthorized reading of data Breach of integrity: unauthorized modification of data Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 5 / 61
  • 12.
    Security Violation Categories Breachof confidentiality: unauthorized reading of data Breach of integrity: unauthorized modification of data Breach of availability: unauthorized destruction of data Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 5 / 61
  • 13.
    Security Violation Categories Breachof confidentiality: unauthorized reading of data Breach of integrity: unauthorized modification of data Breach of availability: unauthorized destruction of data Theft of service: unauthorized use of resources Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 5 / 61
  • 14.
    Security Violation Categories Breachof confidentiality: unauthorized reading of data Breach of integrity: unauthorized modification of data Breach of availability: unauthorized destruction of data Theft of service: unauthorized use of resources Denial of Service (DoS): prevention of legitimate use Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 5 / 61
  • 15.
    Security Violation Methods Masquerading(breach authentication): pretending to be an autho- rized user to escalate privileges Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 6 / 61
  • 16.
    Security Violation Methods Masquerading(breach authentication): pretending to be an autho- rized user to escalate privileges Replay attack: repeat a valid data transmission Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 6 / 61
  • 17.
    Security Violation Methods Masquerading(breach authentication): pretending to be an autho- rized user to escalate privileges Replay attack: repeat a valid data transmission Man-in-the-middle attack: intruder sits in data flow, masquerading as sender to receiver and vice versa Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 6 / 61
  • 18.
    Security Violation Methods Masquerading(breach authentication): pretending to be an autho- rized user to escalate privileges Replay attack: repeat a valid data transmission Man-in-the-middle attack: intruder sits in data flow, masquerading as sender to receiver and vice versa Session hijacking: intercept an already-established session to bypass authentication Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 6 / 61
  • 19.
    Standard Security Attacks AmirH. Payberah (Tehran Polytechnic) Security 1393/9/29 7 / 61
  • 20.
    Security Measure Levels Securitymust occur at four levels to be effective: Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 8 / 61
  • 21.
    Security Measure Levels Securitymust occur at four levels to be effective: • Physical: data centers, servers, connected terminals Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 8 / 61
  • 22.
    Security Measure Levels Securitymust occur at four levels to be effective: • Physical: data centers, servers, connected terminals • Human: only appropriate users have access to the system Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 8 / 61
  • 23.
    Security Measure Levels Securitymust occur at four levels to be effective: • Physical: data centers, servers, connected terminals • Human: only appropriate users have access to the system • OS: protection mechanisms, debugging Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 8 / 61
  • 24.
    Security Measure Levels Securitymust occur at four levels to be effective: • Physical: data centers, servers, connected terminals • Human: only appropriate users have access to the system • OS: protection mechanisms, debugging • Network: intercepted communications, interruption, DOS Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 8 / 61
  • 25.
    Program Threats Amir H.Payberah (Tehran Polytechnic) Security 1393/9/29 9 / 61
  • 26.
    Program Threats Many variations,many names • Trojan horse • Trap door • Logic bomb • Stack and buffer flow • Viruses Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 10 / 61
  • 27.
    Trojan Horse Amir H.Payberah (Tehran Polytechnic) Security 1393/9/29 11 / 61
  • 28.
    Trojan Horse (1/2) Codesegment that misuses its environment. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 12 / 61
  • 29.
    Trojan Horse (1/2) Codesegment that misuses its environment. Exploits mechanisms for allowing programs written by users to be executed by other users. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 12 / 61
  • 30.
    Trojan Horse (1/2) Codesegment that misuses its environment. Exploits mechanisms for allowing programs written by users to be executed by other users. Example: • A text-editor program has a code to search the file to be edited for certain keywords. • If any are found, the entire file may be copied to a special area accessible to the creator of the text editor. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 12 / 61
  • 31.
    Trojan Horse (2/2) Variationof Trojan horse: Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 13 / 61
  • 32.
    Trojan Horse (2/2) Variationof Trojan horse: Emulating a login program Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 13 / 61
  • 33.
    Trojan Horse (2/2) Variationof Trojan horse: Emulating a login program Spyware: accompanies a program that the user has installed. • Download ads to display on the user’s system • Create pop-up browser windows when certain sites are visited • Capture information from the user’s system and return it to a central site: covert channel • Violation of the principle of least privilege. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 13 / 61
  • 34.
    Trap Door Amir H.Payberah (Tehran Polytechnic) Security 1393/9/29 14 / 61
  • 35.
    Trap Door A holein the software that only designer of a program is capable of using. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 15 / 61
  • 36.
    Trap Door A holein the software that only designer of a program is capable of using. Could be included in a compiler. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 15 / 61
  • 37.
    Trap Door A holein the software that only designer of a program is capable of using. Could be included in a compiler. Difficult to detect: we have to analyze all the source code for all components of a system. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 15 / 61
  • 38.
    Logic Bomb Amir H.Payberah (Tehran Polytechnic) Security 1393/9/29 16 / 61
  • 39.
    Logic Bomb Program thatinitiates a security incident under certain circum- stances. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 17 / 61
  • 40.
    Logic Bomb Program thatinitiates a security incident under certain circum- stances. Hard to detect: because under normal operations, there would be no security hole. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 17 / 61
  • 41.
    Stack and BufferFlow Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 18 / 61
  • 42.
    Stack and BufferOverflow (1/6) The most common way for an attacker to gain unauthorized access to the target system. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 19 / 61
  • 43.
    Stack and BufferOverflow (1/6) The most common way for an attacker to gain unauthorized access to the target system. The attack exploits a bug in a program. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 19 / 61
  • 44.
    Stack and BufferOverflow (1/6) The most common way for an attacker to gain unauthorized access to the target system. The attack exploits a bug in a program. • E.g., The programmer neglected to code bounds checking on an input field. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 19 / 61
  • 45.
    Stack and BufferOverflow (1/6) The most common way for an attacker to gain unauthorized access to the target system. The attack exploits a bug in a program. • E.g., The programmer neglected to code bounds checking on an input field. • The attacker sends more data than the program was expecting. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 19 / 61
  • 46.
    Stack and BufferOverflow (1/6) The most common way for an attacker to gain unauthorized access to the target system. The attack exploits a bug in a program. • E.g., The programmer neglected to code bounds checking on an input field. • The attacker sends more data than the program was expecting. • The attacker can write a program to do the next page steps. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 19 / 61
  • 47.
    Stack and BufferOverflow (2/6) 1 Overflow an input field, for example, a web-page form expects a user name, until it writes into the stack. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 20 / 61
  • 48.
    Stack and BufferOverflow (2/6) 1 Overflow an input field, for example, a web-page form expects a user name, until it writes into the stack. 2 Overwrite the current return address on the stack with the address of the exploit code loaded in step 3. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 20 / 61
  • 49.
    Stack and BufferOverflow (2/6) 1 Overflow an input field, for example, a web-page form expects a user name, until it writes into the stack. 2 Overwrite the current return address on the stack with the address of the exploit code loaded in step 3. 3 Write a simple set of code for the next space in the stack that includes the commands that the attacker wishes to execute, for instance, spawn a shell. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 20 / 61
  • 50.
    Stack and BufferOverflow (3/6) Lack of bounds checking If the command line input is longer than BUFFER SIZE? Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 21 / 61
  • 51.
    Stack and BufferOverflow (4/6) Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 22 / 61
  • 52.
    Stack and BufferOverflow (4/6) Automatic variables: variables defined locally to the function. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 22 / 61
  • 53.
    Stack and BufferOverflow (4/6) Automatic variables: variables defined locally to the function. Frame pointer: the address of the beginning of the stack frame. • Can vary during the function call. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 22 / 61
  • 54.
    Stack and BufferOverflow (4/6) Automatic variables: variables defined locally to the function. Frame pointer: the address of the beginning of the stack frame. • Can vary during the function call. Return address: where to return control once the function exits. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 22 / 61
  • 55.
    Stack and BufferOverflow (5/6) The cracker could replace the return address with the address of the code segment containing the attacking program. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 23 / 61
  • 56.
    Stack and BufferOverflow (6/6) Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 24 / 61
  • 57.
    Viruses Amir H. Payberah(Tehran Polytechnic) Security 1393/9/29 25 / 61
  • 58.
    Viruses Code fragment embeddedin legitimate program. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 26 / 61
  • 59.
    Viruses Code fragment embeddedin legitimate program. Self-replicating: designed to infect other computers. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 26 / 61
  • 60.
    Viruses Code fragment embeddedin legitimate program. Self-replicating: designed to infect other computers. Very specific to CPU architecture, OS, applications. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 26 / 61
  • 61.
    Viruses Code fragment embeddedin legitimate program. Self-replicating: designed to infect other computers. Very specific to CPU architecture, OS, applications. Usually borne via email or as a macro. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 26 / 61
  • 62.
    Viruses Code fragment embeddedin legitimate program. Self-replicating: designed to infect other computers. Very specific to CPU architecture, OS, applications. Usually borne via email or as a macro. UNIX and other multiuser OSs generally are not susceptible to viruses. • The executable programs are protected from writing by the OS. • Even if a virus infects such a program, its powers usually are limited because other aspects of the system are protected. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 26 / 61
  • 63.
    Viruses Categories (1/4) Filevirus • Infects a system by appending itself to a file. • It changes the start of the program so that execution jumps to its code. • After it executes, it returns control to the program. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 27 / 61
  • 64.
    Viruses Categories (1/4) Filevirus • Infects a system by appending itself to a file. • It changes the start of the program so that execution jumps to its code. • After it executes, it returns control to the program. Boot virus • Infects the boot sector of the system, executing every time the system is booted and before the OS is loaded. • They are known as memory viruses, because they do not appear in the file system. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 27 / 61
  • 65.
    Viruses Categories (2/4) Macrovirus • Most viruses are in a low-level languages, e.g., assembly or C. • Macro viruses are in a high-level language, e.g., Visual Basic. • For example, a macro virus could be contained in a spreadsheet file. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 28 / 61
  • 66.
    Viruses Categories (2/4) Macrovirus • Most viruses are in a low-level languages, e.g., assembly or C. • Macro viruses are in a high-level language, e.g., Visual Basic. • For example, a macro virus could be contained in a spreadsheet file. Source code virus • Modifies the source code to include the virus and to help spread the virus. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 28 / 61
  • 67.
    Viruses Categories (2/4) Macrovirus • Most viruses are in a low-level languages, e.g., assembly or C. • Macro viruses are in a high-level language, e.g., Visual Basic. • For example, a macro virus could be contained in a spreadsheet file. Source code virus • Modifies the source code to include the virus and to help spread the virus. Polymorphic virus • It changes each time it is installed to avoid detection by anti-virus software. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 28 / 61
  • 68.
    Viruses Categories (3/4) Encryptedvirus • Includes decryption code along with the encrypted virus, again to avoid detection. • The virus first decrypts and then executes. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 29 / 61
  • 69.
    Viruses Categories (3/4) Encryptedvirus • Includes decryption code along with the encrypted virus, again to avoid detection. • The virus first decrypts and then executes. Stealth virus • It avoids detection by modifying parts of the system that could be used to detect it. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 29 / 61
  • 70.
    Viruses Categories (3/4) Encryptedvirus • Includes decryption code along with the encrypted virus, again to avoid detection. • The virus first decrypts and then executes. Stealth virus • It avoids detection by modifying parts of the system that could be used to detect it. Tunneling virus • It bypasses detection by an anti-virus scanner by installing itself in the interrupt-handler chain. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 29 / 61
  • 71.
    Viruses Categories (4/4) Multipartitevirus • It infects multiple parts of a system, including boot sectors, memory, and files. • This makes it difficult to detect and contain. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 30 / 61
  • 72.
    Viruses Categories (4/4) Multipartitevirus • It infects multiple parts of a system, including boot sectors, memory, and files. • This makes it difficult to detect and contain. Armored virus • It is coded to make it hard for anti-virus researchers to unravel and understand. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 30 / 61
  • 73.
    System and NetworkThreats Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 31 / 61
  • 74.
    System and NetworkThreats System and network threats involve the abuse of services and net- work connections. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 32 / 61
  • 75.
    System and NetworkThreats System and network threats involve the abuse of services and net- work connections. They create a situation in which the OS resources and user files are misused. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 32 / 61
  • 76.
    System and NetworkThreats System and network threats involve the abuse of services and net- work connections. They create a situation in which the OS resources and user files are misused. They include: • Worms • Port scanning • Denial of Service (DoS) Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 32 / 61
  • 77.
    Worms (1/2) An standaloneprogram that replicates itself in order to spread to other computers. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 33 / 61
  • 78.
    Worms (1/2) An standaloneprogram that replicates itself in order to spread to other computers. Often, it uses a computer network to spread itself. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 33 / 61
  • 79.
    Worms (1/2) An standaloneprogram that replicates itself in order to spread to other computers. Often, it uses a computer network to spread itself. Unlike a computer virus, it does not need to attach itself to an existing program. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 33 / 61
  • 80.
    Worms (1/2) An standaloneprogram that replicates itself in order to spread to other computers. Often, it uses a computer network to spread itself. Unlike a computer virus, it does not need to attach itself to an existing program. The Morris worm (the Internet worm) is the first computer worms distributed via the Internet: 1988 Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 33 / 61
  • 81.
    Worms (2/2) Morris worm:exploited UNIX networking features in rsh and bugs in finger and sendmail programs. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 34 / 61
  • 82.
    Worms (2/2) Morris worm:exploited UNIX networking features in rsh and bugs in finger and sendmail programs. It made up of two programs: a grappling hook program and the main program. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 34 / 61
  • 83.
    Worms (2/2) Morris worm:exploited UNIX networking features in rsh and bugs in finger and sendmail programs. It made up of two programs: a grappling hook program and the main program. The grappling hook program uploaded main worm program. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 34 / 61
  • 84.
    Port Scanning A meansto detect a system’s vulnerabilities to attack. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 35 / 61
  • 85.
    Port Scanning A meansto detect a system’s vulnerabilities to attack. Automated attempt to connect to a range of ports on IP addresses. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 35 / 61
  • 86.
    Port Scanning A meansto detect a system’s vulnerabilities to attack. Automated attempt to connect to a range of ports on IP addresses. Detection of answering service protocols, OS and version running on system. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 35 / 61
  • 87.
    Port Scanning A meansto detect a system’s vulnerabilities to attack. Automated attempt to connect to a range of ports on IP addresses. Detection of answering service protocols, OS and version running on system. nmap scans all ports in a given IP range for a response Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 35 / 61
  • 88.
    Port Scanning A meansto detect a system’s vulnerabilities to attack. Automated attempt to connect to a range of ports on IP addresses. Detection of answering service protocols, OS and version running on system. nmap scans all ports in a given IP range for a response nessus has a database of protocols and bugs (and exploits) to apply against a system. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 35 / 61
  • 89.
    Denial of Service(DoS) Overload the targeted computer preventing it from doing any useful work. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 36 / 61
  • 90.
    Denial of Service(DoS) Overload the targeted computer preventing it from doing any useful work. Distributed denial-of-service (DDoS) come from multiple sites at once. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 36 / 61
  • 91.
    Denial of Service(DoS) Overload the targeted computer preventing it from doing any useful work. Distributed denial-of-service (DDoS) come from multiple sites at once. Consider traffic to a web site. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 36 / 61
  • 92.
    Denial of Service(DoS) Overload the targeted computer preventing it from doing any useful work. Distributed denial-of-service (DDoS) come from multiple sites at once. Consider traffic to a web site. CS students writing bad fork() code. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 36 / 61
  • 93.
    Cryptography Amir H. Payberah(Tehran Polytechnic) Security 1393/9/29 37 / 61
  • 94.
    Cryptography Cryptography is usedto constrain the potential senders and/or re- ceivers of a message. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 38 / 61
  • 95.
    Cryptography Cryptography is usedto constrain the potential senders and/or re- ceivers of a message. Based on secrets, called keys. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 38 / 61
  • 96.
    Cryptography Cryptography is usedto constrain the potential senders and/or re- ceivers of a message. Based on secrets, called keys. Cryptography enables a recipient of a message to verify that the message was created by some computer possessing a certain key. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 38 / 61
  • 97.
    Cryptography Cryptography is usedto constrain the potential senders and/or re- ceivers of a message. Based on secrets, called keys. Cryptography enables a recipient of a message to verify that the message was created by some computer possessing a certain key. Similarly, a sender can encode its message so that only a computer with a certain key can decode the message. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 38 / 61
  • 98.
    Encryption (1/2) Encryption algorithmconsists of: Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
  • 99.
    Encryption (1/2) Encryption algorithmconsists of: Set K of keys Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
  • 100.
    Encryption (1/2) Encryption algorithmconsists of: Set K of keys Set M of messages Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
  • 101.
    Encryption (1/2) Encryption algorithmconsists of: Set K of keys Set M of messages Set C of ciphertexts (encrypted messages) Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
  • 102.
    Encryption (1/2) Encryption algorithmconsists of: Set K of keys Set M of messages Set C of ciphertexts (encrypted messages) A function E : K → (M → C) • For each k ∈ K, Ek is a function for generating ciphertexts from messages. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
  • 103.
    Encryption (1/2) Encryption algorithmconsists of: Set K of keys Set M of messages Set C of ciphertexts (encrypted messages) A function E : K → (M → C) • For each k ∈ K, Ek is a function for generating ciphertexts from messages. A function D : K → (C → M) • For each k ∈ K, Dk is a function for generating messages from ciphertexts. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 39 / 61
  • 104.
    Encryption (2/2) An encryptionalgorithm must provide this essential property: • Given a ciphertext c ∈ C, a computer can compute m such that Ek (m) = c only if it possesses k. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 40 / 61
  • 105.
    Encryption (2/2) An encryptionalgorithm must provide this essential property: • Given a ciphertext c ∈ C, a computer can compute m such that Ek (m) = c only if it possesses k. Thus, a computer holding k can decrypt ciphertexts to the plain- texts. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 40 / 61
  • 106.
    Symmetric Encryption Same keyused to encrypt and decrypt. • k must be kept secret. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 41 / 61
  • 107.
    Symmetric Encryption Same keyused to encrypt and decrypt. • k must be kept secret. E.g., DES, Triple-DES, AES, RC4 Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 41 / 61
  • 108.
    Asymmetric Encryption Each userhaving two keys: • Public key: published key used to encrypt data. • Private key: key known only to individual user used to decrypt data. Most common is RSA block cipher. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 42 / 61
  • 109.
    Authentication (1/2) Constraining setof potential senders of a message. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
  • 110.
    Authentication (1/2) Constraining setof potential senders of a message. This sort of authentication is similar to but distinct from user au- thentication. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
  • 111.
    Authentication (1/2) Constraining setof potential senders of a message. This sort of authentication is similar to but distinct from user au- thentication. Algorithm components: Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
  • 112.
    Authentication (1/2) Constraining setof potential senders of a message. This sort of authentication is similar to but distinct from user au- thentication. Algorithm components: • A set K of keys Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
  • 113.
    Authentication (1/2) Constraining setof potential senders of a message. This sort of authentication is similar to but distinct from user au- thentication. Algorithm components: • A set K of keys • A set M of messages Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
  • 114.
    Authentication (1/2) Constraining setof potential senders of a message. This sort of authentication is similar to but distinct from user au- thentication. Algorithm components: • A set K of keys • A set M of messages • A set A of authenticators Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
  • 115.
    Authentication (1/2) Constraining setof potential senders of a message. This sort of authentication is similar to but distinct from user au- thentication. Algorithm components: • A set K of keys • A set M of messages • A set A of authenticators • A function S : K → (M → A): for each k ∈ K, Sk is a function for generating authenticators from messages. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
  • 116.
    Authentication (1/2) Constraining setof potential senders of a message. This sort of authentication is similar to but distinct from user au- thentication. Algorithm components: • A set K of keys • A set M of messages • A set A of authenticators • A function S : K → (M → A): for each k ∈ K, Sk is a function for generating authenticators from messages. • A function V : K → (M × A → {true, false}): for each k ∈ K, Vk is a function for verifying authenticators on messages. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 43 / 61
  • 117.
    Authentication (2/2) For amessage m, a computer can generate an authenticator a ∈ A such that Vk(m, a) = true only if it possesses k. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 44 / 61
  • 118.
    Authentication (2/2) For amessage m, a computer can generate an authenticator a ∈ A such that Vk(m, a) = true only if it possesses k. Thus, computer holding k can generate authenticators on messages so that any other computer possessing k can verify them. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 44 / 61
  • 119.
    Authentication (2/2) For amessage m, a computer can generate an authenticator a ∈ A such that Vk(m, a) = true only if it possesses k. Thus, computer holding k can generate authenticators on messages so that any other computer possessing k can verify them. Practically, if Vk(m, a) = true then we know m has not been mod- ified and that send of message has k. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 44 / 61
  • 120.
    Authentication - HashFunction (1/2) Creates small, fixed-size block of data message digest (hash value) from m. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 45 / 61
  • 121.
    Authentication - HashFunction (1/2) Creates small, fixed-size block of data message digest (hash value) from m. Hash Function H must be collision resistant on m. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 45 / 61
  • 122.
    Authentication - HashFunction (1/2) Creates small, fixed-size block of data message digest (hash value) from m. Hash Function H must be collision resistant on m. Must be infeasible to find an m = m such that H(m) = H(m ). • If H(m) = H(m ), then m = m . Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 45 / 61
  • 123.
    Authentication - HashFunction (1/2) Creates small, fixed-size block of data message digest (hash value) from m. Hash Function H must be collision resistant on m. Must be infeasible to find an m = m such that H(m) = H(m ). • If H(m) = H(m ), then m = m . The message has not been modified. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 45 / 61
  • 124.
    Authentication - HashFunction (1/2) Creates small, fixed-size block of data message digest (hash value) from m. Hash Function H must be collision resistant on m. Must be infeasible to find an m = m such that H(m) = H(m ). • If H(m) = H(m ), then m = m . The message has not been modified. E.g., MD5 (128-bit hash), and SHA-1 (160-bit hash) Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 45 / 61
  • 125.
    Authentication - HashFunction (2/2) Not useful as authenticators. • For example H(m) can be sent with a message. • But if H is known someone could modify m to m and recompute H(m ) and modification not detected • So must authenticate H(m): MAC and digital signature Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 46 / 61
  • 126.
    Authentication - MAC Symmetricencryption used in message-authentication code (MAC) authentication algorithm. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 47 / 61
  • 127.
    Authentication - MAC Symmetricencryption used in message-authentication code (MAC) authentication algorithm. Cryptographic checksum generated from message using secret key. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 47 / 61
  • 128.
    Authentication - MAC Symmetricencryption used in message-authentication code (MAC) authentication algorithm. Cryptographic checksum generated from message using secret key. Note that k is needed to compute both Sk and Vk, so anyone able to compute one can compute the other end digital signature. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 47 / 61
  • 129.
    Authentication - DigitalSignature (1/2) Based on asymmetric keys and digital signature algorithm. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 48 / 61
  • 130.
    Authentication - DigitalSignature (1/2) Based on asymmetric keys and digital signature algorithm. Authenticators produced are digital signatures. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 48 / 61
  • 131.
    Authentication - DigitalSignature (1/2) Based on asymmetric keys and digital signature algorithm. Authenticators produced are digital signatures. Anyone can verify authenticity of a message. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 48 / 61
  • 132.
    Authentication - DigitalSignature (1/2) Based on asymmetric keys and digital signature algorithm. Authenticators produced are digital signatures. Anyone can verify authenticity of a message. In a digital-signature algorithm, computationally infeasible to derive ks from kv . Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 48 / 61
  • 133.
    Authentication - DigitalSignature (1/2) Based on asymmetric keys and digital signature algorithm. Authenticators produced are digital signatures. Anyone can verify authenticity of a message. In a digital-signature algorithm, computationally infeasible to derive ks from kv . kv is the public key and ks is the private key. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 48 / 61
  • 134.
    Authentication - DigitalSignature (2/2) Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 49 / 61
  • 135.
    Authentication - KeyDistribution Delivery of a symmetric key is a huge challenge. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
  • 136.
    Authentication - KeyDistribution Delivery of a symmetric key is a huge challenge. • Sometimes done out-of-band, e.g., via a paper document or a conversation Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
  • 137.
    Authentication - KeyDistribution Delivery of a symmetric key is a huge challenge. • Sometimes done out-of-band, e.g., via a paper document or a conversation • If a user wants to communicate with N other users privately: she needs N keys. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
  • 138.
    Authentication - KeyDistribution Delivery of a symmetric key is a huge challenge. • Sometimes done out-of-band, e.g., via a paper document or a conversation • If a user wants to communicate with N other users privately: she needs N keys. Asymmetric keys Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
  • 139.
    Authentication - KeyDistribution Delivery of a symmetric key is a huge challenge. • Sometimes done out-of-band, e.g., via a paper document or a conversation • If a user wants to communicate with N other users privately: she needs N keys. Asymmetric keys • The keys can be exchanged in public. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
  • 140.
    Authentication - KeyDistribution Delivery of a symmetric key is a huge challenge. • Sometimes done out-of-band, e.g., via a paper document or a conversation • If a user wants to communicate with N other users privately: she needs N keys. Asymmetric keys • The keys can be exchanged in public. • A user needs only one private key, no matter how many other people she wants to communicate with. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
  • 141.
    Authentication - KeyDistribution Delivery of a symmetric key is a huge challenge. • Sometimes done out-of-band, e.g., via a paper document or a conversation • If a user wants to communicate with N other users privately: she needs N keys. Asymmetric keys • The keys can be exchanged in public. • A user needs only one private key, no matter how many other people she wants to communicate with. • Man-in-a-middle attack. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
  • 142.
    Authentication - KeyDistribution Delivery of a symmetric key is a huge challenge. • Sometimes done out-of-band, e.g., via a paper document or a conversation • If a user wants to communicate with N other users privately: she needs N keys. Asymmetric keys • The keys can be exchanged in public. • A user needs only one private key, no matter how many other people she wants to communicate with. • Man-in-a-middle attack. • What we need is a proof of who owns a public key? digital certificate Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 50 / 61
  • 143.
    Authentication - DigitalCertificates Digital certificate is an electronic document used to prove ownership of a public key. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 51 / 61
  • 144.
    Authentication - DigitalCertificates Digital certificate is an electronic document used to prove ownership of a public key. It includes information about: • The key • Its owner’s identity • The digital signature of an entity that has verified the certificate’s contents are correct. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 51 / 61
  • 145.
    Authentication - DigitalCertificates Digital certificate is an electronic document used to prove ownership of a public key. It includes information about: • The key • Its owner’s identity • The digital signature of an entity that has verified the certificate’s contents are correct. Certificate authority are trusted party - their public keys included with web browser distributions. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 51 / 61
  • 146.
    Encryption Example -SSL Transport Layer Security (TLS) and its predecessor, Secure Sock- ets Layer (SSL), are cryptographic protocols designed to provide communication security over the Internet. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 52 / 61
  • 147.
    Encryption Example -SSL Transport Layer Security (TLS) and its predecessor, Secure Sock- ets Layer (SSL), are cryptographic protocols designed to provide communication security over the Internet. Insertion of cryptography at one layer of the ISO network model (the transport layer). Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 52 / 61
  • 148.
    User Authentication Amir H.Payberah (Tehran Polytechnic) Security 1393/9/29 53 / 61
  • 149.
    User Authentication Our earlierdiscussion of authentication involves messages and ses- sions. But what about users? Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
  • 150.
    User Authentication Our earlierdiscussion of authentication involves messages and ses- sions. But what about users? If a system cannot authenticate a user, then authenticating that a message came from that user is pointless. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
  • 151.
    User Authentication Our earlierdiscussion of authentication involves messages and ses- sions. But what about users? If a system cannot authenticate a user, then authenticating that a message came from that user is pointless. How do we determine whether a users identity is authentic? Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
  • 152.
    User Authentication Our earlierdiscussion of authentication involves messages and ses- sions. But what about users? If a system cannot authenticate a user, then authenticating that a message came from that user is pointless. How do we determine whether a users identity is authentic? • The user’s possession of something (a key or card) Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
  • 153.
    User Authentication Our earlierdiscussion of authentication involves messages and ses- sions. But what about users? If a system cannot authenticate a user, then authenticating that a message came from that user is pointless. How do we determine whether a users identity is authentic? • The user’s possession of something (a key or card) • The user’s knowledge of something (a user identifier and password) Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
  • 154.
    User Authentication Our earlierdiscussion of authentication involves messages and ses- sions. But what about users? If a system cannot authenticate a user, then authenticating that a message came from that user is pointless. How do we determine whether a users identity is authentic? • The user’s possession of something (a key or card) • The user’s knowledge of something (a user identifier and password) • An attribute of the user (fingerprint, retina pattern, or signature) Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 54 / 61
  • 155.
    Password User identity mostoften established through passwords. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 55 / 61
  • 156.
    Password User identity mostoften established through passwords. Encrypt the passwords • But keep them secret anyway (i.e. Unix uses superuser-only readable file /etc/shadow) • Use algorithm easy to compute but difficult to invert. • Only encrypted password stored, never decrypted. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 55 / 61
  • 157.
    Password User identity mostoften established through passwords. Encrypt the passwords • But keep them secret anyway (i.e. Unix uses superuser-only readable file /etc/shadow) • Use algorithm easy to compute but difficult to invert. • Only encrypted password stored, never decrypted. One-time passwords • Use a function based on a seed to compute a password, both user and computer. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 55 / 61
  • 158.
    Implementing Security Defenses AmirH. Payberah (Tehran Polytechnic) Security 1393/9/29 56 / 61
  • 159.
    Implementing Security Defenses(1/2) Defense in depth is most common security theory: multiple layers of security. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 57 / 61
  • 160.
    Implementing Security Defenses(1/2) Defense in depth is most common security theory: multiple layers of security. Security policy describes what is being secured. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 57 / 61
  • 161.
    Implementing Security Defenses(1/2) Defense in depth is most common security theory: multiple layers of security. Security policy describes what is being secured. Vulnerability assessment compares real state of a system/network to the security policy. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 57 / 61
  • 162.
    Implementing Security Defenses(1/2) Defense in depth is most common security theory: multiple layers of security. Security policy describes what is being secured. Vulnerability assessment compares real state of a system/network to the security policy. Intrusion detection systems to detect attempted or successful intru- sions. • Signature-based detection spots known bad patterns. • Anomaly detection spots differences from normal behavior. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 57 / 61
  • 163.
    Implementing Security Defenses(2/2) Virus protection • Searching all programs or programs at execution for known virus patterns. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 58 / 61
  • 164.
    Implementing Security Defenses(2/2) Virus protection • Searching all programs or programs at execution for known virus patterns. Auditing, accounting, and logging of all or specific system or network activities. Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 58 / 61
  • 165.
    Summary Amir H. Payberah(Tehran Polytechnic) Security 1393/9/29 59 / 61
  • 166.
    Summary Security and Protection AmirH. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
  • 167.
    Summary Security and Protection Securityviolation categories: breach of confidentiality / integrity / availability, theft of service, and DoS Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
  • 168.
    Summary Security and Protection Securityviolation categories: breach of confidentiality / integrity / availability, theft of service, and DoS Security violation methods: masquerading, replay attack, man-in- the-middle, and session hijacking Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
  • 169.
    Summary Security and Protection Securityviolation categories: breach of confidentiality / integrity / availability, theft of service, and DoS Security violation methods: masquerading, replay attack, man-in- the-middle, and session hijacking Program threats: Trojan horse, trap door, logic bomb, stack and buffer flow, viruses Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
  • 170.
    Summary Security and Protection Securityviolation categories: breach of confidentiality / integrity / availability, theft of service, and DoS Security violation methods: masquerading, replay attack, man-in- the-middle, and session hijacking Program threats: Trojan horse, trap door, logic bomb, stack and buffer flow, viruses System and network threats: worms, port scanning, DoS Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
  • 171.
    Summary Security and Protection Securityviolation categories: breach of confidentiality / integrity / availability, theft of service, and DoS Security violation methods: masquerading, replay attack, man-in- the-middle, and session hijacking Program threats: Trojan horse, trap door, logic bomb, stack and buffer flow, viruses System and network threats: worms, port scanning, DoS Cryptography: encryption (symmetric/asymmetric), authentication (MAC/digital signature), key distribution and digital certificate Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
  • 172.
    Summary Security and Protection Securityviolation categories: breach of confidentiality / integrity / availability, theft of service, and DoS Security violation methods: masquerading, replay attack, man-in- the-middle, and session hijacking Program threats: Trojan horse, trap door, logic bomb, stack and buffer flow, viruses System and network threats: worms, port scanning, DoS Cryptography: encryption (symmetric/asymmetric), authentication (MAC/digital signature), key distribution and digital certificate User authentication: password Amir H. Payberah (Tehran Polytechnic) Security 1393/9/29 60 / 61
  • 173.
    Questions? Amir H. Payberah(Tehran Polytechnic) Security 1393/9/29 61 / 61