Network Security: Text Book: Publisher: Prentice Hall Pub Date: October 13, 2006 Print ISBN-10: 0-13-239077-9
Network Security: Text Book: Publisher: Prentice Hall Pub Date: October 13, 2006 Print ISBN-10: 0-13-239077-9
Text book:
Security in Computing, Fourth Edition By Charles P. Pfleeger
Publisher: Prentice Hall
Pub Date: October 13, 2006
Print ISBN-10: 0-13-239077-9
2
Interception, Interruption, modification
and Fabrication
An interception means that some unauthorized party has
gained access to an asset.
The outside party can be a person, a program, or a computing
system.
In an interruption, an asset of the system becomes lost,
unavailable, or unusable.
An example is malicious destruction of a hardware device,
erasure of a program or data file, or malfunction of an operating
system file manager so that it cannot find a particular disk file.
If an unauthorized party not only accesses but tampers with an
asset, the threat is a modification.
For example, someone might change the values in a database,
alter a program so that it performs an additional computation, or
modify data being transmitted electronically. It is even possible
to modify hardware.
An unauthorized party might create a fabrication of
counterfeit objects on a computing system.
3 The intruder may insert spurious transactions to a network
communication system or add records to an existing database.
Security Goals
confidentiality, integrity, and availability.
Confidentiality ensures that computer-related assets are
accessed only by authorized parties. That is, only those who
should have access to something will actually get that access.
By "access," we mean not only reading but also viewing,
printing, or simply knowing that a particular asset exists.
Confidentiality is sometimes called secrecy or privacy.
Integrity means that assets can be modified only by
authorized parties or only in authorized ways. In this context,
modification includes writing, changing, changing status,
deleting, and creating.
Availability means that assets are accessible to authorized
parties at appropriate times. In other words, if some person or
system has legitimate access to a particular set of objects, that
access should not be prevented. For this reason, availability is
sometimes known by its opposite, denial of service.
4
Vulnerabilities of Computing Systems
Logic bomb: the program may be maliciously modified to fail when certain
conditions are met or when a certain date or time is reached.
Trojan horse: a program that overtly does one thing while covertly doing
another
Virus: a specific type of Trojan horse that can be used to spread its
"infection" from one computer to another
Trapdoor: a program that has a secret entry point
Information Leaks in a program: code that makes information accessible
to unauthorized people or programs
5
Methods of Defense
Harm occurs when a threat is realized against a
vulnerability.
To protect against harm, then, we can neutralize the
threat, close the vulnerability, or both. The possibility
for harm to occur is called risk.
We can deal with harm in several ways. We can seek
to
prevent it, by blocking the attack or closing the
vulnerability
deter it, by making the attack harder but not impossible
deflect it, by making another target more attractive (or
this one less so)
detect it, either as it happens or some time after the fact
6 recover from its effects
Multiple Controls
To consider the controls or countermeasures that attempt to prevent exploiting a
computing system's vulnerabilities, we begin by thinking about traditional ways to
enhance physical security.
We have many controls at our disposal.
Some are easier than others to use or implement.
Some are cheaper than others to use or implement. And some are more difficult than
others for intruders to override.
7
Encryption
Encryption is the formal name for the scrambling process.
We take data in their normal, unscrambled state, called cleartext,
and transform them so that they are unintelligible to the outside
observer; the transformed data are called enciphered text or
ciphertext.
Using encryption, security professionals can virtually nullify the
value of an interception and the possibility of effective
modification or fabrication.
Encryption is the basis of protocols that enable us to provide
security while accomplishing an important system or network
task.
Encryption does not solve all computer security problems, and
other tools must complement its use.
If encryption is not used properly, it may have no effect on
security or could even degrade the performance of the entire
system.
8
Weak encryption can actually be worse than no encryption at all,
because it gives users an unwarranted sense of protection.
Software Controls
Program controls include the following:
Internal program controls
Parts of the program that enforce security restrictions, such as access
limitations in a database management program
Operating system and network system controls
Limitations enforced by the operating system or network to protect each
user from all other users
Independent control programs
Application programs, such as password checkers, intrusion detection
utilities, or virus scanners, that protect against certain types of
vulnerabilities
Development controls
Quality standards under which a program is designed, coded, tested, and
maintained to prevent software faults from becoming exploitable
9 vulnerabilities
Hardware Controls
Numerous hardware devices have been created to
assist in providing computer security.
These devices include a variety of means, such as
Hardware or smart card implementations of encryption
Locks or cables limiting access or deterring theft
Devices to verify users' identities
Firewalls
Intrusion detection systems
Circuit boards that control access to storage media
1
0
Elementary Cryptography
Terminology
Encryption is the process of encoding a message so that its meaning is not
obvious;
Decryption is the reverse process, transforming an encrypted message back
into its normal, original form.
Alternatively, the terms encode and decode or encipher and decipher are used
instead of encrypt and decrypt.
A system for encryption and decryption is called a cryptosystem
For convenience, we denote a plaintext message P as a sequence of individual
characters P = <p1, p2, …, pn>. Similarly, ciphertext is written as C = <c1, c2, …, cm>.
For instance, the plaintext message "I want cookies" can be denoted as the message
string <I, ,w,a,n,t, , c,o,o,k,i,e,s>.
It can be transformed into ciphertext <c 1, c2, …, c14>, and the encryption algorithm
tells us how the transformation is done.
1
2
…Terminology
C = E(P) and P = D(C), where C represents the
ciphertext, E is the encryption rule, P is the plaintext,
and D is the decryption rule.
What we seek is a cryptosystem for which P =
D(E(P)).
We want to be able to convert the message to protect it
from an intruder, but we also want to be able to get the
original message back so that the receiver can read it
properly
1
3
Encryption Algorithms
The encryption and decryption rules, called algorithms, often use a
device called a key, denoted by K, so that the resulting ciphertext
depends on the original plaintext message, the algorithm, and the key
value.
We write this dependence as C = E(K, P). Essentially, E is a set of
encryption algorithms, and the key K selects one specific algorithm
from the set.
Sometimes the encryption and decryption keys are the same, so P =
D(K, E(K,P)). This form is called symmetric encryption because D
and E are mirror-image processes.
At other times, encryption and decryption keys come in pairs. Then, a
decryption key, KD, inverts the encryption of key KE so that P = D(KD,
E(KE,P)).
Encryption algorithms of this form are called asymmetric because
converting C back to P involves a series of steps and a key that are
different from the steps and key of E.
1
4
Symmetric and Asymmetric Cryptosystems
T R E A T Y IM P O S S I B L E
w u h d w b l p s r v v l e o h
1
9
Advantages and Disadvantages of the
Caesar Cipher
Advantage:
Simple
Disadvantage:
Algorithm has to be secret
Once Algorithm is known all messages can be decrypted
20
Cryptanalysis of the Caesar
Cipher
The break between the two words is preserved in the ciphertext, and double letters are preserved: The
SS is translated to vv.
We might also notice that when a letter is repeated, it maps again to the same ciphertext as it did
previously.
So the letters T, I, and E always translate to w, l, and h. These clues make this cipher easy to break.
Suppose you are given the following ciphertext message, and you want to try to determine the
original plaintext.
wklv phvvdjh lv qrw wrr kdug wr euhdn
The message has actually been enciphered with a 27-symbol alphabet: A through Z plus the "blank"
character or separator between words.
As a start, assume that the coder was lazy and has allowed the blank to be translated to itself. If your
assumption is true, it is an exceptional piece of information; knowing where the spaces are allows us
to see which are the small words.
English has relatively few small words, such as am, is, to, be, he, we, and, are, you, she, and so on.
Therefore, one way to attack this problem and break the encryption is to substitute known short words
at appropriate places in the ciphertext until you have something that seems to be meaningful.
21
Other Substitutions
In substitutions, the alphabet is scrambled, and each plaintext letter maps to a unique
ciphertext letter.
We can describe this technique in a more mathematical way. Formally, we say that a
permutation is a reordering of the elements of a sequence.
We can permute the numbers l to 10 in many ways, including the permutations n 1 = 1,
3, 5, 7, 9, 10, 8, 6, 4, 2; and n2 = 10, 9, 8, 7, 6, 5, 4, 3, 2, 1.
A permutation is a function, so we can write expressions such as n 1(3) = 5 meaning
that the letter in position 3 is to be replaced by the fifth letter. If the set is the first ten
letters of the alphabet, n1(3) = 5 means that c is transformed into E.
One way to scramble an alphabet is to use a key, a word that controls the permutation.
For instance, if the key is word, the sender or receiver first writes the alphabet and
then writes the key under the first few letters of the alphabet.
ABCDEFGHIJKLMNOPQRSTUVWXYZ word
The sender or receiver then fills in the remaining letters of the alphabet, in some easy-
to-remember order, after the keyword.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
wordabcefghijklmnpqstuvxyz
22
The Vernam Cipher
The basic encryption involves an arbitrarily long nonrepeating sequence of numbers
that are combined with the plaintext.
Vernam's invention used an arbitrarily long punched paper tape that fed into a
teletype machine.
The tape contained random numbers that were combined with characters typed into
the teletype.
The sequence of random numbers had no repeats, and each tape was used only once.
As long as the key tape does not repeat or is not reused, this type of cipher is immune
to cryptanalytic attack because the available ciphertext does not display the pattern of
the key.
23
Transpositions (Permutations)
A transposition is an encryption in which the letters of the message are
rearranged.
With transposition, the cryptography aims for diffusion, widely spreading the
information from the message or the key across the ciphertext.
Transpositions try to break established patterns. Because a transposition is a
rearrangement of the symbols of a message, it is also known as a permutation.
Columnar Transpositions
The columnar transposition is a rearrangement of the characters of the plaintext into
columns.
The following set of characters is a five-column transposition. The plaintext characters are
written in rows of five and arranged one row after another, as shown here.
24
What Makes a "Secure" Encryption
Algorithm?
What does it mean for a cipher to be “Secure/good"? The meaning of
good depends on the intended use of the cipher.
A cipher to be used by military personnel in the field has different requirements from
one to be used in a secure installation with substantial computer support.
Shannon's Characteristics of "Good" Ciphers
The amount of secrecy needed should determine the amount of labor appropriate for
the encryption and decryption
The set of keys and the enciphering algorithm should be free from complexity
The implementation of the process should be as simple as possible
Errors in ciphering should not propagate and cause corruption of further information
in the message
The size of the enciphered text should be no larger than the text of the original
message
25
Properties of "Trustworthy"
Encryption Systems
It is based on sound mathematics.
Good cryptographic algorithms are not just invented; they are derived from solid
principles.
It has been analyzed by competent experts and found to be sound.
Even the best cryptographic experts can think of only so many possible attacks, and
the developers may become too convinced of the strength of their own algorithm.
Thus, a review by critical outside experts is essential.
It has stood the "test of time."
As a new algorithm gains popularity, people continue to review both its mathematical
foundations and the way it builds on those foundations.
Although a long period of successful use and analysis is not a guarantee of a good
algorithm, the flaws in many algorithms are discovered relatively soon after their
release.
26
Symmetric Encryption Systems
There two basic kinds of encryptions are symmetric (also called "secret key") and
asymmetric (also called "public key").
The symmetric systems provide a two-way channel to their users: A and B share a secret
key, and they can both encrypt information to send to the other as well as decrypt
information from the other.
The symmetry of this situation is a major advantage of this type of encryption, but it also
leads to a problem: key distribution. How do A and B obtain their shared secret key? And
only A and B can use that key for their encrypted communications.
If A wants to share encrypted communication with another user C, A and C need a
different shared key. Key distribution is the major difficulty in using symmetric
encryption.
In general, n users who want to communicate in pairs need n * (n - 1)/2 keys.
In other words, the number of keys needed increases at a rate proportional to the square
of the number of users! So a property of symmetric encryption systems is that they
require a means of key distribution.
27
Asymmetric Encryption Systems
Public key systems excel at key management.
By the nature of the public key approach, we can send a public key in
an e-mail message or post it in a public directory.
Only the corresponding private key, which presumably is kept private,
can decrypt what has been encrypted with the public key.
But for both kinds of encryption, a key must be kept well secured.
Once the symmetric or private key is known by an outsider, all
messages written previously or in the future can be decrypted (and
hence read or modified) by the outsider.
So, for all encryption algorithms, key management is a major issue. It
involves storing, safeguarding, and activating keys.
28
Stream Ciphers
Most of the ciphers we have presented so far are stream ciphers; that is, they convert
one symbol of plaintext immediately into a symbol of ciphertext.
The transformation depends only on the symbol, the key, and the control information
of the encipherment algorithm.
Some kinds of errors, such as skipping a character in the key during encryption, affect
the encryption of all future characters.
Such errors can sometimes be recognized during decryption because the plaintext will
be properly recovered up to a point, and then all following characters will be wrong.
If that is the case, the receiver may be able to recover from the error by dropping a
character of the key on the receiving end.
29
Block Cipher
A block cipher encrypts a group of plaintext symbols as one block.
The columnar transposition and other transpositions are examples of block
ciphers. In the columnar transposition, the entire message is translated as one
block.
The block size need not have any particular relationship to the size of a
character.
Block ciphers work on blocks of plaintext and produce blocks of ciphertext.
30
Comparing Stream and Block Algorithms
Stream Encryption Block Encryption Algorithms
Algorithms
Low diffusion High diffusion
Each symbol is separately enciphered. Therefore, Information from the plain-text is diffused into
all the information of that symbol is contained in several cipher text symbols. One cipher text block
one symbol of the cipher text may depend on several plaintext letters
31
Confusion and Diffusion
The interceptor should not be able to predict what will happen to the ciphertext
by changing one character in the plaintext. We call this characteristic
confusion.
An algorithm providing good confusion has a complex functional relationship
between the plaintext/key pair and the ciphertext.
In this way, it will take an interceptor a long time to determine the relationship between plaintext,
key, and ciphertext; therefore, it will take the interceptor a long time to break the code.
The cipher should also spread the information from the plaintext over the entire
ciphertext so that changes in the plaintext affect many parts of the ciphertext.
This principle is called diffusion, the characteristic of distributing the
information from single plaintext letters over the entire output.
Good diffusion means that the interceptor needs access to much of the
ciphertext to be able to infer the algorithm.
32
The Data Encryption Standard
In 1972 the NBS issued a call for proposals for producing a public encryption algorithm.
The call specified desirable criteria for such an algorithm:
Able to provide a high level of security
Specified and easy to understand
Publishable so that security does not depend on the secrecy of the algorithm
Available to all users
Adaptable for use in diverse applications
Economical to implement in electronic devices
Efficient to use
Able to be validated
Exportable
The data encryption algorithm developed by IBM for NBS was based on Lucifer
Algorithm(IBM), and it became known as the Data Encryption Standard, although its
proper name is DEA (Data Encryption Algorithm) in the United States and DEA1 (Data
Encryption Algorithm-1) in other countries.
33
Overview of the DES Algorithm
The DES algorithm is a careful and complex combination of two fundamental
building blocks of encryption: substitution and transposition.
The algorithm derives its strength from repeated application of these two
techniques, one on top of the other, for a total of 16 cycles.
The sheer complexity of tracing a single bit through 16 iterations of
substitutions and transpositions has so far stopped researchers in the public
from identifying more than a handful of general properties of the algorithm.
The algorithm begins by encrypting the plaintext as blocks of 64 bits. The
key is 64 bits long, but in fact it can be any 56-bit number. (The extra 8 bits
are often used as check digits and do not affect encryption in normal
implementations.)
The user can change the key at will any time there is uncertainty about the
security of the old key.
34
…Overview of the DES Algorithm
That is, the algorithm accomplishes two
things:
Ensuring that the output bits have no
obvious relationship to the input bits
and
Spreading the effect of one plaintext
bit to other bits in the ciphertext.
Substitution provides the confusion, and
transposition provides the diffusion.
In general, plaintext is affected by a
series of cycles of a substitution then a
permutation.
The iterative substitutions and
permutations are performed as shown
35
Double DES
Computing power has increased rapidly over the last few decades, and
it promises to continue to do so.
For this reason, the DES 56-bit key length is not long enough for some
people to feel comfortable.
Double DES
To address the discomfort, some researchers suggest using a double
encryption for greater secrecy.
i.e. take two keys, k1 and k2, and perform two encryptions, one on top
of the other: E(k2, E(k1,m)). In theory, this approach should multiply
the difficulty of breaking the encryption, just as two locks are harder to
pick than one.
36
Triple DES
However, a simple trick does indeed enhance the security of DES.
Using three keys adds significant strength.
The so-called triple DES procedure is C = E(k3, E(k2, E(k1,m))).
That is, you encrypt with one key, decrypt with the second, and encrypt with a third.
This process gives a strength equivalent to a 112-bit key (because the double DES
attack defeats the strength of one of the three keys).
A minor variation of triple DES, which some people also confusingly
call triple DES, is C = E(k1, D(k2, E(k1,m))).
That is, you encrypt with one key, decrypt with the second, and encrypt with the first
again. This version requires only two keys. (The second decrypt step also makes this
process work for single encryptions with one key: The decryption cancels the first
encryption, so the net result is one encryption.)
37
The Advanced Encryption Standard (AES)
Encryption Algorithm
Rijndael is a fast algorithm that can be implemented easily on simple processors.
Although it has a strong mathematical foundation, it primarily uses substitution;
transposition; and the shift, exclusive OR, and addition operations.
Like DES, AES uses repeat cycles.
There are 10, 12, or 14 cycles for keys of 128, 192, and 256 bits, respectively. In
Rijndael, the cycles are called "rounds."
Each cycle consists of four steps.
Byte substitution: This step uses a substitution box structure similar to the DES, substituting each byte of a
128-bit block according to a substitution table. This is a straight diffusion operation.
Shift row: A transposition step. For 128- and 192-bit block sizes, row n is shifted left circular (n - 1) bytes;
for 256-bit blocks, row 2 is shifted 1 byte and rows 3 and 4 are shifted 3 and 4 bytes, respectively. This is a
straight confusion operation.
Mix column: This step involves shifting left and exclusive-ORing bits with themselves. These operations
provide both confusion and diffusion.
Add subkey: Here, a portion of the key unique to this cycle is exclusive-ORed with the cycle result. This
operation provides confusion and incorporates the key.
38
Comparison of DES and AES
39
Public Key Encryption
Key Proliferation
To see how, let kPRIV be a user's private key, and let kPUB be the corresponding public key.
Then, encrypted plaintext using the public key is decrypted by application of the private key; we
write the relationship as
P = D(kPRIV, E(kPUB, P))
That is, a user can decode with a private key what someone else has encrypted with the
corresponding public key.
Furthermore, with some public key encryption algorithms, including RSA, we have this
relationship:
P = D(kPUB, E(kPRIV, P))
40
Comparing Secret Key and Public Key
Encryption
41
Rivest Shamir Adelman
Encryption
RSA relies on an area of mathematics known as number theory, in which
mathematicians study properties of numbers such as their prime factors.
The RSA encryption algorithm combines results from number theory with the
degree of difficulty in determining the prime factors of a given number.
The RSA algorithm also operates with arithmetic mod n like many others.
The two keys used in RSA, d and e, are used for decryption and encryption.
They are actually interchangeable: Either can be chosen as the public key, but
one having been chosen, the other one must be kept private.
P = E(D(P)) = D(E(P))
(You can think of E and D as two complementary functions, each of which "undoes" the
other.)
42
… Rivest Shamir Adelman Encryption
Any plaintext block P is encrypted as Pe mod n.
Because the exponentiation is performed mod n, factoring P e to uncover the
encrypted plaintext is difficult.
However, the decrypting key d is carefully chosen so that (Pe)d mod n = P.
Thus, the legitimate receiver who knows d simply computes (P e)d mod n = P
and recovers P without having to factor Pe.
The encryption algorithm is based on the underlying problem of factoring
large numbers.
So far, nobody has found a shortcut or easy way to factor large numbers in a
finite set called a field.
In a highly technical but excellent paper, Boneh reviews all the known cryptanalytic attacks
on RSA and concludes that none is significant.
Because the factorization problem has been open for many years, most cryptographers
consider this problem a solid basis for a secure cryptosystem.
43