CNS_PPTs
CNS_PPTs
Mr.B.Ramji,
Sr.AssistantProfessor
Cryptography and Network security
ATTACKS ON COMPUTERS
AND
COMPUTER SECURITY
Definitions
Definitions
Security Attack
Any action that compromises the security of
information owned by an organization
Information security is about how to prevent
attacks, or failing that, to detect attacks on
information-based systems
Often threat & attack used to mean same thing
Have a wide range of attacks
Can focus of generic types of attacks
Passive Attack
Active Attack
Passive Attacks
Active Attacks
Security Service
Enhance security of data processing
systems and information transfers of an
organization
Intended to counter security attacks
Using one or more security mechanisms
Often replicates functions normally associated with
physical documents
Which, for example, have signatures, dates; need
protection from disclosure, tampering, or
destruction; be notarized or witnessed; be
recorded or licensed
Security Services
X.800:
“A service provided by a protocol layer of
communicating open systems, which ensures
adequate security of the systems or of data transfers”
RFC 2828:
“A processing or communication service provided by a
system to give a specific kind of protection to system
resources”
Security Services (X.800)
Authentication - assurance that the
communicating entity is the one claimed
Access Control - prevention of the unauthorized use of a
resource
Data Confidentiality – protection of data from
unauthorized disclosure
Data Integrity - assurance that data received is as sent by
an authorized entity
Non-Repudiation - protection against denial by one of the
parties in a communication
Security Mechanism
M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
Encrypting and Decrypting
Plaintext is encrypted two letters at a time
if both letters fall in the same row, replace each
with letter to right(wrapping back to start
from end)
if both letters fall in the same column, replace
each with the letter below it (again wrapping
to top from bottom)
otherwise each letter is replaced by the letter in
the same row and in the column of the other
letter of the pair
if a pair is a repeated letter, insert filler like
'X’
Security of Playfair Cipher
UNIT-2
SYMMETRIC KEY CIPHERS
Modern Block Ciphers
Now look at modern block ciphers
One of the most widely used types of
cryptographic algorithms
Provide secrecy /authentication services
Focus on DES (Data Encryption Standard)
To illustrate block cipher design principles
Block vs Stream Ciphers
Block size
Key size
Number of rounds
Subkey generation algorithm
Rround function
Fast software en/decryption
Ease of analysis
Feistel Cipher Decryption
Data Encryption Standard (DES)
= R XOR P ;
L17 16 18
=L XOR i ;
R17 16 17
where
F[a,b,c,d] = ((S1,a + S2,b) XOR
S ) + S
3,c 4,a
Break 32-bit Ri into (a,b,c,d)
Modes of Operation
Block ciphers encrypt fixed size blocks
eg. DES encrypts 64-bit blocks with 56-bit key
Need some way to en/decrypt arbitrary amounts of data in
practise
ANSI X3.106-1983 Modes of Use (now FIPS 81)
defines 4 possible modes
Subsequently 5 defined for AES & DES
have block and stream modes
Electronic Codebook Book (ECB)
Message is broken into independent blocks which
are encrypted
Each block is a value which is substituted, like a
codebook, hence name
Each block is encoded independently of the other
blocks
Ci = DESK1(Pi)
Uses: secure transmission of single values
Electronic Codebook Book (ECB)
Advantages and Limitations of ECB
Message repetitions may show in ciphertext
if aligned with message block
particularly with data such graphics
or with messages that change very little, which
become a code- book analysis problem
Weakness is due to the encrypted message blocks
being independent
Main use is sending a few blocks of data
Cipher Block Chaining (CBC)
Message is broken into blocks
Linked together in encryption operation
Each previous cipher blocks is chained with current
plaintext block, hence name
Use Initial Vector (IV) to start process Ci
= DESK1(Pi XOR Ci-1)
C-1= IV
Uses: bulk data encryption, authentication
Cipher Block Chaining (CBC)
Message Padding
At end of message must handle a possible last short block
which is not as large as blocksize of cipher
pad either with known non-data value (eg nulls)
or pad last block along with count of pad size
eg. [ b1 b2 b3 0 0 0 0 5]
means have 3 data bytes, then 5 bytes
pad+count
this may require an extra entire block over those
in message
There are other, more esoteric modes, which avoid the need
for an extra block
Advantages and Limitations of CBC
Aciphertext block depends on all blocks before it
Any change to a block affects all following
ciphertext blocks
Need Initialization Vector (IV)
which must be known to sender & receiver
if sent in clear, attacker can change bits of first
block, and change IV to compensate hence IV
must either be a fixed value (as in EFTPOS)
or must be sent encrypted in ECB mode
before rest of message
Cipher FeedBack (CFB)
Message is treated as a stream of bits
added to the output of the block cipher
Result is feed back for next stage (hence name)
Standard allows any number of bit (1,8, 64 or 128 etc)
to be feed back
denoted CFB-1, CFB-8, CFB-64, CFB-128 etc
Most efficient to use all bits in block (64 or 128)
Ci = Pi XOR DESK1(Ci-1)
C-1 = IV
Uses: stream data encryption, authentication
Cipher FeedBack (CFB)
Advantages and Limitations of CFB
Appropriate when data arrives in bits/bytes
most common stream mode
Limitation is need to stall while do block encryption
after every n-bits
Note that the block cipher is used in encryption
mode at both ends
Errors propogate for several blocks after the error
Output FeedBack (OFB)
Message is treated as a stream of bits
Output of cipher is added to message
Output is then feed back (hence name)
Feedback is independent of message
Can be computed in advance Ci=
Pi XOR Oi
Oi= DESK1(Oi-1) O-1
IV
Uses: stream encryption on noisy channels
Advantages and Limitations of OFB
Bit errors do not propagate
More vulnerable to message stream modification
Avariation of a Vernam cipher
hence must never reuse the same sequence
(key+IV)
Sender & receiver must remain in sync
Originally specified with m-bit feedback
Subsequent research has shown that only full block
feedback (ie CFB-64 or CFB-128) should ever be used
Counter (CTR)
A “new” mode, though proposed early on
Similar to OFB but encrypts counter value rather than
any feedback value
Must have a different key & counter value for every
plaintext block (never reused)
Ci = Pi XOR Oi
Oi= DESK1(i)
Uses: high-speed network encryptions
Counter (CTR)
ADVANTAGES and Limitations of CTR
Efficiency
can do parallel encryptions in h/w or s/w
can preprocess in advance of need
good for bursty high speed links
Random access to encrypted data blocks
Provable security (good as other modes)
But must ensure never reuse key/counter values,
otherwise could break (cf OFB)
Stream Ciphers
Process message bit by bit (as a stream)
Have a pseudo random keystream
Combined (XOR) with plaintext bit by bit
Randomness of stream key completely destroys
statistically properties in message
Ci = Mi XOR StreamKeyi
But must never reuse stream key
otherwise can recover messages (cf book cipher)
Stream Cipher Structure
Stream Cipher Properties
Some design considerations are:
long period with no repetitions
statistically random
depends on large enough key
large linear complexity
Properly designed, can be as secure as a block cipher
Confidentiality (encryption)
Limited traffic flow confidentiality
Security Associations
A one-way relationship between sender & receiver that
affords security for traffic flow
Defined by 3 parameters:
Security Parameters Index (SPI)
IP Destination Address
Security Protocol Identifier
Has a number of other parameters
seq no, AH & EH info, lifetime etc
Have a database of Security Associations
Authentication Header (AH)
Provides support for data integrity & authentication of
IP packets
end system/router can authenticate user/app
prevents address spoofing attacks by tracking
sequence numbers
Based on use of a MAC
HMAC-MD5-96 or HMAC-SHA-1-96
Parties must share a secret key
Authentication Header
Transport & Tunnel Modes
Encapsulating Security Payload (ESP)
Provides message content confidentiality & limited traffic
flow confidentiality
Can optionally provide the same authentication services
as AH
Supports range of ciphers, modes, padding
incl. DES, Triple-DES, RC5, IDEA, CAST etc
CBC & other modes
padding needed to fill blocksize, fields, for traffic
flow
Encapsulating Security Payload
Transport vs Tunnel Mode ESP
Transport mode is used to encrypt & optionally
authenticate IP data
data protected but header left in clear
can do traffic analysis but is efficient
good for ESP host to host traffic
Tunnel mode encrypts entire IP packet
add new header for next hop
good for VPNs, gateway to gateway security
Combining Security Associations
SA’s can implement either AH or ESP
To implement both need to combine SA’s
form a security association bundle
may terminate at different or same endpoints
combined by
transport adjacency
iterated tunneling
Issue of authentication & encryption order
Combining Security Associations
Key Management
Handles key generation & distribution
Typically need 2 pairs of keys
2 per direction for AH & ESP
Manual key management
sysadmin manually configures every system
Automated key management
automated system for on demand creation of
keys for SA’s in large systems
has Oakley & ISAKMP elements
Oakley
A key exchange protocol
Based on Diffie-Hellman key exchange
Adds features to address weaknesses
cookies, groups (global params), nonces, DH key
exchange with authentication
Can use arithmetic in prime fields or elliptic curve fields
ISAKMP
Internet Security Association and Key Management Protocol
Provides framework for key management
Defines procedures and packet formats to
establish, negotiate, modify, & delete SAs
Independent of key exchange protocol, encryption alg, &
authentication method
ISAKMP
ISAKMP Payloads & Exchanges
Have a number of ISAKMP payload types:
Security, Proposal, Transform, Key, Identification,
Certificate, Certificate, Hash, Signature, Nonce,
Notification, Delete
ISAKMP has framework for 5 types of message
exchanges:
base, identity protection, authentication only,
aggressive,
informational
UNIT-5 UNIT-V
WEB SECURITY
Web Security
Web now widely used by business, government,
individuals
but Internet & Web are vulnerable
have a variety of threats
integrity
confidentiality
denial of service
authentication
need added security mechanisms
SSL (Secure Socket Layer)
Transport layer security service
Originally developed by Netscape
Version 3 designed with public input
Subsequently became Internet standard known as TLS
(Transport Layer Security)
Uses TCP to provide a reliable end-to-end service
SSL has two layers of protocols
SSL Architecture
SSL Architecture
SSL connection
A transient, peer-to-peer, communications link
Associated with 1 SSL session
SSL session
An association between client & server
Created by the Handshake Protocol
Define a set of cryptographic parameters
May be shared by multiple SSL connections
SSL Record Protocol Services
Message integrity
using a MAC with shared secret key
similar to HMAC but with different padding
Confidentiality
using symmetric encryption with a shared secret
key definedby Handshake Protocol
AES, IDEA, RC2-40, DES-40, DES, 3DES, Fortezza,
RC4-40, RC4-128
message is compressed before encryption
SSL Record Protocol Operation
SSL Change Cipher Spec Protocol
One of 3 SSL specific protocols which use the SSL Record
protocol
A single message
Causes pending state to become current
Hence updating the cipher suite in use
SSL Alert Protocol
Conveys SSL-related alerts to peer entity
Severity warning or fatal
Specific alert
fatal: unexpected message, bad record mac,
decompression failure, handshake failure, illegal
parameter
warning: close notify, no certificate, bad
certificate, unsupported certificate, certificate
revoked, certificate expired, certificate unknown
Compressed & encrypted like all SSL data
SSL Handshake Protocol
Allows server & client to:
authenticate each other
to negotiate encryption & MAC
algorithms
to negotiate cryptographic keys to be
used
Comprises a series of messages in phases
Establish Security Capabilities
Server Authentication and Key
Exchange
Client Authentication and Key
Exchange
Finish
SSL Handshake Protocol
TLS (Transport Layer Security)
IETF standard RFC 2246 similar to SSLv3
with minor differences
in record format version number
uses HMAC for MAC
a pseudo-random function expands secrets
has additional alert codes
some changes in supported ciphers
changes in certificate types & negotiations
changes in crypto computations & padding
Secure Electronic Transactions
(SET)
Generic decryption
use CPU simulator to check program signature &
behavior before actually running it
Digital immune system (IBM)
general purpose emulation & virus detection
any virus entering org is captured,
analyzed, detection/shielding created
for it, removed
Digital Immune System
Behavior-Blocking Software
Integrated with host O/S monitors
program behavior in real-time
eg file access, disk format, executable
mods, system settings changes,
network access
For possibly malicious actions
if detected can block, terminate, or seek
ok
Has advantage over scanners
But malicious code runs before detection
Distributed Denial of Service
Attacks (DDoS)
Distributed Denial of Service (DDoS) attacks form a significant
security threat
making networked systems unavailable
by flooding with useless traffic
using large numbers of “zombies”
growing sophistication of attacks
defense technologies struggling to cope
Distributed Denial of Service
Attacks (DDoS)
Contructing the DDoS Attack Network