Chapter 15 security
Download
1 / 83

Chapter 15: Security 15.2 Silberschatz - PowerPoint PPT Presentation


  • 669 Views
  • Uploaded on

Chapter 15: Security Chapter 15: Security The Security Problem Program Threats System and Network Threats Cryptography as a Security Tool User Authentication Implementing Security Defenses Firewalling to Protect Systems and Networks Computer-Security Classifications

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Chapter 15: Security 15.2 Silberschatz' - jana


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Chapter 15 security2 l.jpg
Chapter 15: Security

  • The Security Problem

  • Program Threats

  • System and Network Threats

  • Cryptography as a Security Tool

  • User Authentication

  • Implementing Security Defenses

  • Firewalling to Protect Systems and Networks

  • Computer-Security Classifications

  • An Example: Windows XP


Objectives l.jpg
Objectives

  • To discuss security threats and attacks

  • To explain the fundamentals of encryption, authentication, and hashing

  • To examine the uses of cryptography in computing

  • To describe the various countermeasures to security attacks


The security problem l.jpg
The Security Problem

  • A system is secure if its resources are used and accessed as intended under all circumstances.

  • Total security cannot be achieved.


The security problem5 l.jpg
The Security Problem

  • Security must consider external environment of the system, and protect the system resources

  • Intruders (crackers) attempt to breach security

  • Threat is potential security violation

    • Eg, a discovery of a vulnerability

  • Attack is attempt to breach security

  • Attack can be accidental or malicious

    • Easier to protect against accidental than malicious misuse


Security violations l.jpg
Security Violations

  • Categories

    • Breach of confidentiality

      • Involves unauthorized reading of data (theft of information)

      • Ex: stealing credit-card info or identity info for identity theft

    • Breach of integrity

      • Unauthorized modification of data

      • Can result in passing of liability to an innocent party

      • Can result in modification of commercial application

    • Breach of availability

      • Unauthorized destruction of data

      • Ex: defacing of a web page

      • Often for bragging rights


Security violations7 l.jpg
Security Violations

  • Categories (cont)

    • Theft of service

      • Unauthorized use of resources

      • Ex: using someones computer as a porn server

    • Denial of service

      • Preventing legitimate use of the system

      • DOS is sometimes accidental

      • The original internet worm became a DOS when a bug failed to delay its rapid spread.


Security violations8 l.jpg
Security Violations

  • Methods(see next slide)

    • Masquerading (breach authentication)

      • One participant in a communication pretends to be someone else

      • Could be another host or person.

      • Goal is to gain access that they would not normally be allowed

      • Or could try to escalate their privileges

    • Replay attack

      • Replay a captured exchange of data

      • Sometimes the replay is the attack: ex: repeat of a request to transfer money

      • Message modification: replace some data in the replay to obtain access for unauthorized user.

    • Man-in-the-middle attack

      • Attacker sits in the data flow of a communication

      • Masquerades as the sender to the receiver and vice versa

    • Session hijacking

      • An active comunication session is intercepted.



Security measure levels l.jpg
Security Measure Levels

  • Security must occur at four levels to be effective:

    • Physical

      • Physically secure the computers

    • Human

      • Avoid social engineering

        • Phishing: a legitimate-looking e-mail or web page misleads a user into entering confidential information

        • dumpster diving: looking through trash, finding phone books, etc

    • Operating System

      • The system must protect itself from accidental or purposeful security breaches.

      • Ex: a runaway process

      • Stack overflow

    • Network

      • Intercepting data traveling between comptuers

  • Security is as week as the weakest chain


Program threats l.jpg
Program Threats

  • The most common goal of crackers:

    • Write a program that creates a breach of security

    • Or cause a normal process to change its behavior and create a breach

  • Example:

    • Useful to log into a system without authorization

    • More useful to leave behind a back-door daemon that provides info or allows easy access even if the original exploit is blocked.


Program threats12 l.jpg
Program Threats

  • Trojan Horse

    • Code segment that misuses its environment

    • Exploits mechanisms for allowing programs written by users to be executed by other users

    • Spyware, pop-up browser windows, covert channels

  • Examples

    • Text-editor program may include code to search the file to be edited for certain keywords

      • These are then saved in a hidden file accessible to the creator of the text editor.


Program threats13 l.jpg
Program Threats

  • Trojan Horse more examples:

    • Long search paths (the PATH environmental variable)

    • If not every path is secure, could execute wrong program

    • Example: use of the "." in the path (search current directory)

      • If you go to a friend's directory and execute a command, the command may be run from her directory

      • This would give the program her permissions

      • Could delete her files, etc.


Program threats14 l.jpg
Program Threats

  • Trojan Horse (cont)

  • More examples:

    • Example: a program that emulates a login program

      • User logs in at a terminal and notices that he as apparently mistyped his password

      • He tries again and is successful

      • What really happened? His account name/password were stolen by the login emulator that was left running by the thief.

      • The emulator stored his information, printed out a login error message, and exited.

      • User then got the real prompt.

    • Protection:

      • Use non-trappable key sequence (ctrl-alt-delete)

      • Have the OS print a usage message at the end of an interactive session instead of just a new login prompt


Program threats15 l.jpg
Program Threats

  • Trojan Horse (cont)

  • More examples:

    • Spyware.

      • Sometimes accompanies a program that the user has chosen to install

      • Sometimes with freeware/shareware sometimes with commercial software

      • Goals:

        • Download ads to display on the user's system

        • Create pop-up windows when certain sites are visited

        • Capture info from the user's system and return it to a central site.

      • Cover Channel attack

        • Surreptitious communication occurs

        • A spyware daemon is loaded

        • It contacts a central site and is given a message and a list of recipient addresses

        • It delivers the spam message to those users from the infected machine

        • 80% of spam was delivered this way in 2004!


Program threats16 l.jpg
Program Threats

  • Trojan Horse more examples (cont)

    • Spyware.

      • Real problem: violation of the principle of least privilege

      • Usually a user of an operating system does not need to install network daemons

      • Such daemons are installed via two mistakes

        • First: a user may choose to run with more privileges than necessary (eg, as administrator)

          • This allows programs that she runs to have more access to the system than is necessary

        • Second: an OS may allow by default more privileges than a normal user needs.


Program threats17 l.jpg
Program Threats

  • Trap Door

    • The designer of a program or system might leave a hole in the software that only she is capable of using.

    • Used in the movie War Games.

    • Example: program recognizes a specific user identifier or password that circumvents normal security procedures

    • Example: programmer for a bank might include rounding errors in their code and have the resulting half-cent deposited in their account

    • Could be included in a compiler

      • Compiler generates standard object code

      • Also includes the trap door.

      • Hard to find: searching the source code will not reveal the trap door; it is only in the compiler!


Program threats18 l.jpg
Program Threats

  • Logic Bomb

    • Program that initiates a security incident under certain circumstances

    • Under normal circumstances there is no security hole.

    • When a predefined set of parameters were met, the security hole is created.

    • Example: programmer writes code that checks to see if she is still employed

      • If not, a daemon is spawned to allow remote access or to damage the site.


Program threats19 l.jpg
Program Threats

  • Stack and Buffer Overflow

    • Most common technique for attacker from outside the system to gain unauthorized access to the target system.

    • Exploits a bug in a program

      • overflow either the stack or memory buffers

      • Usually programmer neglected to code bounds checking on an input field

      • Attacker sends more data than the program expects


Program threats20 l.jpg
Program Threats

  • Stack and Buffer Overflow

    • Using trial & error (or examining code if open source), attacker writes a program to do the following:

    • Overflow an input field, command-line argument, or input buffer for a program (like a network daemon) until it writes into the stack

    • Overwrite the current return address and insert the address of the exploit code loaded in step 3.

    • Write a simple set of code for the next space in the stack that includes the commands that the attacker wishes to execute

      • Example to spawn a shell

    • Result is a root shell or other privileged command execution.


Program threats21 l.jpg
Program Threats

  • Stack and Buffer Overflow example:

    • Web-page form expects a user name in a field

    • Attacker sends the user name, plus extra characters to overflow the buffer and reach the stack

    • Plus, a new return address to load onto the stack, plus the code the attacker wants to run.

    • When the buffer-reading subroutine returns from execution, the return address is the exploit code and the code is run.

    • See next slide


C program with buffer overflow condition l.jpg
C Program with Buffer-overflow Condition

#include <stdio.h>

#define BUFFER SIZE 256

int main(int argc, char *argv[])

{

char buffer[BUFFER SIZE];

if (argc < 2)

return -1;

else {

strcpy(buffer,argv[1]);

return 0;

}

}

Creates a character array

Copies the contents of the command line parameter into the buffer.

This works fine as long as the input parameter is less than BUFFER SIZE (also need one byte to store '\0')


C program with buffer overflow condition23 l.jpg
C Program with Buffer-overflow Condition

#include <stdio.h>

#define BUFFER SIZE 256

int main(int argc, char *argv[])

{

char buffer[BUFFER SIZE];

if (argc < 2)

return -1;

else {

strcpy(buffer,argv[1]);

return 0;

}

}

Creates a character array

Copies the contents of the command line parameter into the buffer.

What if the command line parameter is too long?

strcpy will copy from argv[1] until it hits a '\0' or until the program crashes!


C program with buffer overflow condition24 l.jpg
C Program with Buffer-overflow Condition

#include <stdio.h>

#define BUFFER SIZE 256

int main(int argc, char *argv[])

{

char buffer[BUFFER SIZE];

if (argc < 2)

return -1;

else {

strcpy(buffer,argv[1]);

return 0;

}

}

Creates a character array

Copies the contents of the command line parameter into the buffer.

To prevent:use strncpy instead of strcpy:

strncopy(buffer, argv[1], sizeof(buffer)-1);


C program with buffer overflow condition25 l.jpg
C Program with Buffer-overflow Condition

  • Assume this type of stack:

How is this used?

See next slide!

buffer

When the buffer space is overwritten, the data goes into the return address.

Return address

Return val

When the subroutine returns, goes to the address that was overwritten.


Layout of typical stack frame l.jpg
Layout of Typical Stack Frame

The saved frame pointer allows the frame pointer to be restored when the subroutine returns.

(ie, local variables)


Buffer overflow attack l.jpg
Buffer-overflow attack

Cracker's goal:

replace the return address in the stack frame so that it now points to the code segment containing the attacking program


Modified shell code l.jpg
Modified Shell Code

Cracker writes below code.

execvp creates a shell process.

This process has all the permissions that the original program had.

The below code must be compiled and its assembly language modified so that it can fit into a stack frame.

The code will be a binary sequence of code that is the heart of the attack.

#include <stdio.h>

int main(int argc, char *argv[])

{

execvp(‘‘\bin\sh’’,‘‘\bin \sh’’, NULL);

return 0;

}


C program with buffer overflow condition29 l.jpg
C Program with Buffer-overflow Condition

Consider this code again.

Assume that the resulting stack frame is organized as shown on the next slide.

#include <stdio.h>

#define BUFFER SIZE 256

int main(int argc, char *argv[])

{

char buffer[BUFFER SIZE];

if (argc < 2)

return -1;

else {

strcpy(buffer,argv[1]);

return 0;

}

}


Hypothetical stack frame l.jpg
Hypothetical Stack Frame

Add the location of buffer[0] to the end of the code so that it overwrites the return address field.

5. Start the attack by entering your modified attack code as the command line parameter.

2. Append the attack code to the buffer data. Fill the attack code with the right number of NO_OP instructions to fill the stack frame right up to the return address

4. Now when the function returns, it will jump to the address of buffer[0] instead and run the attacker's code.

Using a debugger, the cracker finds the address of buffer[0] in the stack.

That address will become the location of the code the attacker wants executed.

After attack

Before attack


Buffer overflow attack31 l.jpg
Buffer-overflow attack

  • Once a cracker has created a buffer-overflow or stack-overflow exploit, he can release it on the net.

    • A script kiddie, someone with rudimentary computer skills, can then employ the exploit

  • A buffer-overflow exploit can be run between systems and over allowed communication channels.

    • Can use the exploit within protocols that are expected to be used to communicate with the target machine

    • Are thus hard to detect


Buffer overflow attack32 l.jpg
Buffer-overflow attack

  • Solution1:

    • CPU can have a feature that disallows execution of code in a stack section of memory.

    • Recent Sun sparc chips have this; recent versions of solaris use it.

    • Return address can still be modified, but when code in a stack segment attempts to execute, an automatic exception is generated.

  • Solution 2:

    • AMD/Intex X86 chips have the NX feature

    • New bit added to the page tables of CPUs

    • Marks the associated page as nonexecutable

      • Instructions cannot be read from this page

    • Linux and Windows XP SP2 use this bit.


Program threats cont l.jpg
Program Threats (Cont.)

  • Viruses

    • Code fragment embedded in legitimate program

    • Very specific to CPU architecture, operating system, applications

    • Self-replicating and designed to "infect" other programs

    • Used to modify or destroy files and programs

    • Windows more susceptible than UNIX

      • In UNIX executable programs are protected from being written on by the OS

    • Usually borne via email or as a macro

      • Spam is the most common vector

      • Can spread via downloaded files


Program threats cont34 l.jpg
Program Threats (Cont.)

  • Viruses

    • Macro viruses

      • Takes advantage of MS Office files

      • These documents can contain macros (VB programs)

      • Macros are executed automatically when the Office program is opened

      • Visual Basic Macro to reformat hard drive

        Sub AutoOpen()

        Dim oFS

        Set oFS = CreateObject(’’Scripting.FileSystemObject’’)

        vs = Shell(’’c:command.com /k format c:’’,vbHide)

        End Sub


Program threats cont35 l.jpg
Program Threats (Cont.)

  • Virus dropper inserts virus onto the system

    • This is often a Trojan horse program whose real purpose is to insert the virus

  • Many categories of viruses, literally many thousands of viruses

    • File

      • Infects a system by appending itself to a file.

      • Changes the start of the program so that execution jumps to its code

      • After it executes, it returns control to the program so that its execution is not noticed.

    • Boot

      • Infects the boot sector of the system

      • Executes every time the system is booted, before OS is loaded.

      • Watches for other bootable media (eg, floppy disks) and infects them.

      • Do not appear in the file system.

      • See next slide.



Viruses cont l.jpg
Viruses (cont)

  • Virus Categories (cont)

    • Macro

      • Most common are MS Office macro viruses

    • Source code

      • Looks for source code and modifies it to include the virus and to help spread the virus.

    • Polymorphic

      • Virus changes each time it is installed to avoid detection by anit-virus software.

      • Changes do not affect the virus's functionality, just its signature.

      • A signature is a series of bytes that make up the code; can be used to identify the virus.

    • Encrypted

      • Virus is encrypted and includes decryption code along with the encrypted virus to avoid detection.

      • Virus first decrypts itself, then executes.


Viruses cont38 l.jpg
Viruses (cont)

  • Virus Categories (cont)

    • Stealth

      • Modifies parts of the system that could be used to detect it.

      • Eg, could modify the read system call so that if the file it has modified is read, the original form of the code is returned rather than the infected code.

    • Tunneling

      • Virus attempts to bypass detection by an antivirus scanner by installing itself in the interrupt-handler chain or a device driver

    • Multipartite

      • Infects multiple parts of a system including boot sectors, memory, and files

      • Makes it difficult to detect

    • Armored

      • Coded to make itself hard for antivirus researchers to unravel and understand.

      • Can also be compressed to avoid detection

      • Also virus droppers and other full files that are part of the virus infestation are hidden via file attributes or unviewable file names.


Viruses cont39 l.jpg
Viruses (cont)

  • Monoculture

    • Majority of computers use a version of the Windows OS

    • Does this make it easier for viruses to spread?


System and network threats l.jpg
System and Network Threats

  • System and Network threats involve the abuse of services and network connections.

  • Sometimes a system and network attack is used to launch a program attack, sometimes vice versa.

  • Masquerading and replay attacks are also common over networks

    • These attacks are more effective and harder to counter

    • Involve multiple systems

    • Any one system often cannot trace the sender of the attack.


System and network threats41 l.jpg
System and Network Threats

  • Worms –

    • use spawn mechanism to create copies of itself

    • Uses up system resources and perhaps locking out other processes

    • Especially bad on a network; worms reproduce themselves among systems and can shut down the entire network

    • standalone program


System and network threats42 l.jpg
System and Network Threats

  • Internet worm

    • November 2, 1988. Robert Tappan Morris Jr., a first-year Cornell graduate student unleashed the first worm on the internet.

    • Exploited UNIX networking features (remote access) and bugs in finger and sendmail programs

      • Targeted Sun’s Sun 3 workstations and VAX computers running variants of Version 4 BSD UNIX

      • Within a few hours it had consumed system resources to the point of bringing down the infected machines.

    • How it spread

      • Morris chose for the initial infection an Internet host left open for and accessible to outside users

      • From there the worm exploited flaws in the UNIX OS security routines

      • Also took advantage of UNIX utilities that simplify resource sharing in LANs.

      • Thereby gained access to other connected sites.


System and network threats43 l.jpg
System and Network Threats

  • Internet worm

    • Worm was composed of two parts:

      • Grappling hook (or bootstrap or vector) program uploaded main worm program

        • named i1.c

        • Consisted of 99 lines of C code.

        • Was compiled and run on each machine it accessed.

        • Once created on the attacked machine, this program connected to the machine where it originated and uploaded a copy of the main worm onto the hooked machine


System and network threats44 l.jpg
System and Network Threats

  • Internet worm

    • Worm was composed of two parts:

      • Main program

        • Searched for other machines to which the newly infected system could connect easily

        • Used the UNIX networking utility rsh for easy remote task execution.

        • By setting up special files that list host-login name pairs, users can omit entering a password each time they access a remote account on the paired list

        • The worm searched these special files for site names that would allow remote execution without a password

        • These the worm uploaded the grappling hook to


System and network threats45 l.jpg
System and Network Threats

  • Internet worm: other exploits

    • finger

      • finger is an electronic telephone directory.

      • Runs as a background process (daemon) for each BSD site

      • Responds to queries throughout the internet

      • The worm executed a buffer-overflow attack on finger

      • Queried finger with a 536-byte string

      • This exceeded the buffer allocated for input and overwrote stack frame.

      • Instead of returning to main, finger returned to a procedure within the invading 536-byte string now on the stack

      • The new procedure executed /bin/sh and gave the worm a remote shell on the machine


System and network threats46 l.jpg
System and Network Threats

  • Internet worm: other exploits

    • sendmail

      • Debugging code in sendmail permits testers to verify and display the state of the mail system

      • This option was useful to sys-ads and was often left on

      • Worm did a call to debug that, instead of specifying a user address, issued a set of commands that mailed and executed a copy of the grappling-hook program


System and network threats47 l.jpg
System and Network Threats

  • Internet worm: other exploits

    • passwords

      • Worm systematically attempted to discover user passwords

      • Began by trying simple cases of no password or of passwords constructed of account-user-name combinations

      • Then used an internal dictionary of 432 favorite password choices

      • Then tried all words in the standard UNIX on-line dictionary.

      • When worm got access to an account, it looked for rsh data files and used them as described before



The morris internet worm49 l.jpg
The Morris Internet Worm

  • Spreading

    • With each new access, the worm searched for already existing copies of itself

    • If found one, the new copy exited.

    • In every 7th instance, did not exit.

  • Containing

    • Cooperative efforts over the internet developed solutions quickly

    • By evening of the second day, Nov 3, methods of halting the invading program were circulated to sys-ads via the internet

    • Within days, patches were available

  • Result

    • Morris: 3 years probation, 400 hours community service, $10,000 fine, over $100,000 in legal fees


W32 sobig f@mm internet worm l.jpg
[email protected] Internet Worm

  • August 2003, was the 5th version of the Sobig worm

  • Released by persons unknown

  • Fastest-spreading worm released to date

  • Infected hundreds of thousands of computers and 1 in 17 e-mail messages on the internet.

  • Was launched by being uploaded to a porn newsgroup via an account created with a stolen credit card.

  • Disguised as a photo

  • Targeted MS systems


W32 sobig f@mm internet worm51 l.jpg
[email protected] Internet Worm

  • Used its own SMTP engine to e-mail itself to all addresses found on an infected system.

  • Used a variety of subject lines (“Thank You!”, “Your Details”, “Re: Approved”, etc.)

  • Used a random address on the “from” address.

  • Included an attachment for the target e-mail reader to click on, with a variety of names

  • If the payload was executed, it stored a program called WINPPR32.EXE in the default Windows directory, along with a text file.

  • Also modified the Windows registry.

  • Code also programmed to periodically attempt to connect ot one of 20 servers and download and execute a program form them.

  • The servers were disabled before the code could be downloaded. The program has never been deciphered.


System and network threats52 l.jpg
System and Network Threats

  • Port scanning

    • Automated attempt to connect via TCP/IP to a range of ports on one or a range of IP addresses

    • Not an attack, but a means for a cracker to detect a system’s vulnerabilities to attack.

    • Example: suppose there is a known vulnerability in sendmail

      • Cracker could launch a prot scanner to try to connect to say port 25 (often used for sendmail)

      • If the connection was successful, the tool could attempt to communicate with the answering service to determine if it was sendmail and, if so, it was the version with a bug.


System and network threats53 l.jpg
System and Network Threats

  • Port scanning

    • Imagine a tool in which each bug of every service of every operating system was encoded.

      • Tool could attempt to connect to every port of one or more systems

      • Every service that answered would be attacked

      • If successful, attack could install Trojan horses, back-door programs, spyware, etc.

    • There is no such tool.

      • But there are tools that perform a subset of that functionality


System and network threats54 l.jpg
System and Network Threats

  • Example: nmap (http://www.insecure.org/nmap/)

    • A very versatile open-source utility for network exploration and security auditing

    • When pointed at a target, will determine what services are running, including app names and versions and OS version

    • Can also provide info about defenses (firewalls, etc.)

    • Does not exploit

  • Example: nessus (http://www.nessus.org/) performs similarly.

    • Has a DB of bugs and exploits

    • Will scan a range of systems and attack

    • Generates reports about the results

    • Does not exploit


System and network threats55 l.jpg
System and Network Threats

  • Port scanning is detectable

    • So are frequently launched from zombie machines

      • A previously compromised, independent system

      • Users are unaware that they are compromised

      • Can be used for DOS and spam relay


System and network threats56 l.jpg
System and Network Threats

  • Denial of Service

    • Overload the targeted computer preventing it from doing any useful work

    • Usually the attacker has not penetrated this machine

    • Two categories:

      • Attack that uses so many facility resources that no useful work can be done

        • Example: a web site click downloads a Java applet that uses all available CPU time or infinitely pops up windows

      • Second: disrupt the network of the facility

    • Distributed denial-of-service (DDOS) come from multiple sites at once

      • Usually use zombies


System and network threats57 l.jpg
System and Network Threats

  • Denial of Service: example

    • Abuse of TCP/IP

    • Attacker sents the part of the protocol that says “I want to start a TCP connection

    • But never sends the part that says “The connection is now complete”

    • Get lots of partially started TCP sessions; enough can eat up system resources, denying legitimate uses

  • Solution:

    • In general, not possible to stop

    • The attacks use the same mechanisms as normal operation


Cryptography as a security tool l.jpg
Cryptography as a Security Tool

  • Broadest security tool available

    • Source and destination of messages cannot be trusted without cryptography

    • Means to constrain potential senders (sources) and / or receivers (destinations) of messages

  • Based on secrets (keys)



Encryption l.jpg
Encryption

  • Encryption algorithm consists of

    • Set of K keys

    • Set of M Messages

    • Set of C ciphertexts (encrypted messages)

    • A function E : K → (M→C). That is, for each k K, E(k) is a function for generating ciphertexts from messages.

      • Both E and E(k) for any k should be efficiently computable functions.

    • A function D : K → (C → M). That is, for each k K, D(k) is a function for generating messages from ciphertexts.

      • Both D and D(k) for any k should be efficiently computable functions.

  • An encryption algorithm must provide this essential property: Given a ciphertext c  C, a computer can compute m such that E(k)(m) = c only if it possesses D(k).

    • Thus, a computer holding D(k) can decrypt ciphertexts to the plaintexts used to produce them, but a computer not holding D(k) cannot decrypt ciphertexts.

    • Since ciphertexts are generally exposed (for example, sent on the network), it is important that it be infeasible to derive D(k) from the ciphertexts


Symmetric encryption l.jpg
Symmetric Encryption

  • Same key used to encrypt and decrypt

    • E(k) can be derived from D(k), and vice versa

  • DES is most commonly used symmetric block-encryption algorithm (created by US Govt)

    • Encrypts a block of data at a time

  • Triple-DES considered more secure

  • Advanced Encryption Standard (AES), twofish up and coming

  • RC4 is most common symmetric stream cipher, but known to have vulnerabilities

    • Encrypts/decrypts a stream of bytes (i.e wireless transmission)

    • Key is a input to psuedo-random-bit generator

      • Generates an infinite keystream


Asymmetric encryption l.jpg
Asymmetric Encryption

  • Public-key encryption based on 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

  • Must be an encryption scheme that can be made public without making it easy to figure out the decryption scheme

    • Most common is RSA block cipher

    • Efficient algorithm for testing whether or not a number is prime

    • No efficient algorithm is know for finding the prime factors of a number


Asymmetric encryption cont l.jpg
Asymmetric Encryption (Cont.)

  • Formally, it is computationally infeasible to derive D(kd , N) from E(ke , N), and so E(ke , N) need not be kept secret and can be widely disseminated

    • E(ke , N) (or just ke) is the public key

    • D(kd , N) (or just kd) is the private key

    • N is the product of two large, randomly chosen prime numbers p and q (for example, p and q are 512 bits each)

    • Encryption algorithm is E(ke , N)(m) = mkemod N, where kesatisfies kekd mod (p−1)(q −1) = 1

    • The decryption algorithm is then D(kd , N)(c) = ckdmod N


Asymmetric encryption example l.jpg
Asymmetric Encryption Example

  • For example. make p = 7and q = 13

  • We then calculate N = 7∗13 = 91 and (p−1)(q−1) = 72

  • We next select kerelatively prime to 72 and< 72, yielding 5

  • Finally,we calculate kdsuch that kekdmod 72 = 1, yielding 29

  • We how have our keys

    • Public key, ke, N = 5, 91

    • Private key, kd , N = 29, 91

  • Encrypting the message 69 with the public key results in the cyphertext 62

  • Cyphertext can be decoded with the private key

    • Public key can be distributed in cleartext to anyone who wants to communicate with holder of public key



Cryptography cont l.jpg
Cryptography (Cont.)

  • Note symmetric cryptography based on transformations, asymmetric based on mathematical functions

    • Asymmetric much more compute intensive

    • Typically not used for bulk data encryption


Authentication l.jpg
Authentication

  • Constraining set of potential senders of a message

    • Complementary and sometimes redundant to encryption

    • Also can prove message unmodified

  • Algorithm components

    • A set K of keys

    • A set M of messages

    • A set A of authenticators

    • A function S : K → (M→ A)

      • That is, for each k K, S(k) is a function for generating authenticators from messages

      • Both S and S(k) for any k should be efficiently computable functions

    • A function V : K → (M× A→ {true, false}). That is, for each k K, V(k) is a function for verifying authenticators on messages

      • Both V and V(k) for any k should be efficiently computable functions


Authentication cont l.jpg
Authentication (Cont.)

  • For a message m, a computer can generate an authenticator a A such that V(k)(m, a) = true only if it possesses S(k)

  • Thus, computer holding S(k) can generate authenticators on messages so that any other computer possessing V(k) can verify them

  • Computer not holding S(k) cannot generate authenticators on messages that can be verified using V(k)

  • Since authenticators are generally exposed (for example, they are sent on the network with the messages themselves), it must not be feasible to derive S(k) from the authenticators


Authentication hash functions l.jpg
Authentication – Hash Functions

  • Basis of authentication

  • 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

  • Common message-digest functions include MD5, which produces a 128-bit hash, and SHA-1, which outputs a 160-bit hash


Authentication mac l.jpg
Authentication - MAC

  • Symmetric encryption used in message-authentication code (MAC) authentication algorithm

  • Simple example:

    • MAC defines S(k)(m) = f (k, H(m))

      • Where f is a function that is one-way on its first argument

        • k cannot be derived from f (k, H(m))

      • Because of the collision resistance in the hash function, reasonably assured no other message could create the same MAC

      • A suitable verification algorithm is V(k)(m, a) ≡ ( f (k,m) = a)

      • Note that k is needed to compute both S(k) and V(k), so anyone able to compute one can compute the other


Authentication digital signature l.jpg
Authentication – Digital Signature

  • Based on asymmetric keys and digital signature algorithm

  • Authenticators produced are digital signatures

  • In a digital-signature algorithm, computationally infeasible to derive S(ks) from V(kv)

    • V is a one-way function

    • Thus, kvis the public key and ksis the private key

  • Consider the RSA digital-signature algorithm

    • Similar to the RSA encryption algorithm, but the key use is reversed

    • Digital signature of message S(ks)(m) = H(m)ks mod N

    • The key ksagain is a pair d, N, where N is the product of two large, randomly chosen prime numbers p and q

    • Verification algorithm is V(kv)(m, a) ≡ (akvmod N = H(m))

      • Where kvsatisfies kvksmod (p − 1)(q − 1) = 1


Authentication cont72 l.jpg
Authentication (Cont.)

  • Why authentication if a subset of encryption?

    • Fewer computations (except for RSA digital signatures)

    • Authenticator usually shorter than message

    • Sometimes want authentication but not confidentiality

      • Signed patches et al

    • Can be basis for non-repudiation


Key distribution l.jpg
Key Distribution

  • Delivery of symmetric key is huge challenge

    • Sometimes done out-of-band

  • Asymmetric keys can proliferate – stored on key ring

    • Even asymmetric key distribution needs care – man-in-the-middle attack



Digital certificates l.jpg
Digital Certificates

  • Proof of who or what owns a public key

  • Public key digitally signed a trusted party

  • Trusted party receives proof of identification from entity and certifies that public key belongs to entity

  • Certificate authority are trusted party – their public keys included with web browser distributions

    • They vouch for other authorities via digitally signing their keys, and so on


Encryption example ssl l.jpg
Encryption Example - SSL

  • Insertion of cryptography at one layer of the ISO network model (the transport layer)

  • SSL – Secure Socket Layer (also called TLS)

  • Cryptographic protocol that limits two computers to only exchange messages with each other

    • Very complicated, with many variations

  • Used between web servers and browsers for secure communication (credit card numbers)

  • The server is verified with a certificate assuring client is talking to correct server

  • Asymmetric cryptography used to establish a secure session key (symmetric encryption) for bulk of communication during session

  • Communication between each computer theb uses symmetric key cryptography


User authentication l.jpg
User Authentication

  • Crucial to identify user correctly, as protection systems depend on user ID

  • User identity most often established through passwords, can be considered a special case of either keys or capabilities

    • Also can include something user has and /or a user attribute

  • Passwords must be kept secret

    • Frequent change of passwords

    • Use of “non-guessable” passwords

    • Log all invalid access attempts

  • Passwords may also either be encrypted or allowed to be used only once


Implementing security defenses l.jpg
Implementing Security Defenses

  • 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 system / network compared to security policy

  • Intrusion detection endeavors to detect attempted or successful intrusions

    • Signature-based detection spots known bad patterns

    • Anomaly detection spots differences from normal behavior

      • Can detect zero-day attacks

    • False-positives and false-negatives a problem

  • Virus protection

  • Auditing, accounting, and logging of all or specific system or network activities


Firewalling to protect systems and networks l.jpg
Firewalling to Protect Systems and Networks

  • A network firewall is placed between trusted and untrusted hosts

    • The firewall limits network access between these two security domains

  • Can be tunneled or spoofed

    • Tunneling allows disallowed protocol to travel within allowed protocol (i.e. telnet inside of HTTP)

    • Firewall rules typically based on host name or IP address which can be spoofed

  • Personal firewall is software layer on given host

    • Can monitor / limit traffic to and from the host

  • Application proxy firewall understands application protocol and can control them (i.e. SMTP)

  • System-call firewall monitors all important system calls and apply rules to them (i.e. this program can execute that system call)



Computer security classifications l.jpg
Computer Security Classifications

  • U.S. Department of Defense outlines four divisions of computer security: A, B, C, and D.

  • D – Minimal security.

  • C – Provides discretionary protection through auditing. Divided into C1 and C2. C1 identifies cooperating users with the same level of protection. C2 allows user-level access control.

  • B – All the properties of C, however each object may have unique sensitivity labels. Divided into B1, B2, and B3.

  • A – Uses formal design and verification techniques to ensure security.


Example windows xp l.jpg
Example: Windows XP

  • Security is based on user accounts

    • Each user has unique security ID

    • Login to ID creates security access token

      • Includes security ID for user, for user’s groups, and special privileges

      • Every process gets copy of token

      • System checks token to determine if access allowed or denied

  • Uses a subject model to ensure access security. A subject tracks and manages permissions for each program that a user runs

  • Each object in Windows XP has a security attribute defined by a security descriptor

    • For example, a file has a security descriptor that indicates the access permissions for all users



ad