









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










SFWR 4C03: Computer Networks & Computer Security Mar 15-18, 2004
Lecturer: Kartik Krishnan Lecture 27-
We compare the public and symmetric key cryptographic schemes in Table
Message authentication is a procedure to verify that received messages come from the alleged source and have not been altered in transit. They may also verify sequencing (any modification to a sequence of messages) and timeliness (delay or replay of messages). On the other hand, a digital signature also includes measures to counter repudiation by the source. There is an essential difference between authentication and signatures: authentication is to protect the two communicating parties (Alice/Bob) from a 3rd party (Oscar/Trudy) who masquerades as either Alice or Bob, or modifications of the messages in transit. Authentication cannot help if Alice and Bob do not trust each other; a digital signature is a solution to this problem. Alice’s digital signature on a message reassures Bob that it indeed came from Alice, and Alice cannot deny sending this message at a later time. Any message authentication or digital signature mechanism can be viewed as having fundamentally two levels. At the lower level, there must be some sort of function that produces an authenticator: a value to be used to authenticate the message. This lower-level function is then used as a primitive in a higher- level authentication protocol that enables a receiver to verify the authenticity of a message. There are two classes of functions that can be used to produce an authenticator:
Table 9.1 CONVENTIONAL AND PUBLIC-KEY ENCRYPTION
Conventional Encryption Public-Key Encryption Needed to Work:
Needed for Security:
Needed to Work:
Figure 1: Symmetric and Public-Key Encryption
Message Authentication code:
An overview of the entire process is given in Figure 3. message that serves as
Source A Destination B
(a) Message authentication
(c) Message authentication and confidentiality; authentication tied to ciphertext
Figure 11.4 Basic Uses of Message Authentication Code (MAC)
K^ Compare
(b) Message authentication and confidentiality; authentication tied to plaintext
Compare
Compare
Figure 3: Basic use of a message authentication code
the authenticator. The MAC authentication technique involves the use of a secret key to generate a small fixed-size block of data, known as cryptographic checksum or MAC that is appended to the message. This technique assumes that the communicating parties Alice and Bob share a common secret key K. When Alice has a message to send to Bob, she calculates the MAC as a function of the message M and the key K, i.e., M AC = CK (M ). The message M plus M AC are transmitted to the intended recipient. Bob performs the same calculation on the received message, using the same key, to generate a new MAC. The received MAC is compared to the calculated MAC (see Figure 3). If we assume that
only Alice and Bob know the identity of the secret key, then Bob is assured that the message has not been altered in transit. The idea is that since the attacker does not know the secret key he/she cannot alter the MAC to correspond to alterations in the message. Also, Bob knows that the message came from Alice, since she alone knew the secret key. A MAC function is similar to encryption. One difference is that since the MAC maps an arbitrary length message into a shorter fixed-length message, the MAC function is general a many-to-one function. Finally, computing the MAC function is much faster than conventional en- cryption.
Hash function:
An overview of the entire process is shown in Figures 4 and 5. This is a variation of the message authentication code. As with the MAC, a hash function accepts a variable-size message M as input and produces a fixed-size output, referred to as a hash code H(M ). Unlike a MAC, a hash code does not use a key but is a function only of the input message. The hash code is also referred to as a message digest or hash value. The hash code is a function of all the bits of the message and provides an error-detection capability. A change to any bit or bits results in a change to the hash code. A hash function is much faster to compute from a MAC since no key is involved in the computation, but a MAC provides better authentication in an unsecure channel. The requirements for a hash function H are the following:
The first three properties are requirements for the practical application of a hash function to message authentication. Sometimes as shown in Figure 5 (e) a secret code S is added to the message M before their concatenation is hashed (note that there is no encryption of the hashed component of the message here); it is important here that fourth property hold so that the opponent cannot decipher the secret code S. The fifth property prevents a forgery of a given message: an attacker intercepts a message plus its encrypted hash function, generates an unencrypted hash code from the message, and finally generates an alternate message with the same hash code. The sixth property makes the hash function resistant to an attack known as the birthday attack. All the hash functions operate using the following general principles. The input message is viewed as a sequence of n-bit blocks. The input is processed
KRa KU (^) a
Compare
(d)
(e)
Compare
(f)
Compare
Figure 11.5 Basic Uses of Hash Function (page 2 of 2)
E KRa [H( M )]
Source A Destination B
Figure 5: Basic use of a hash function (continued)
one block at a time in an iterative fashion to produce an n-bit hash function. One of the simplest hash functions is the bit-by-bit exclusive-OR (XOR) of every block. This can be expressed as follows:
Ci = bi 1 ⊕ bi 2 ⊕... bim
where
Ci = ith bit of the hash code, 1 ≤ i ≤ n m = number of n blocks in the input bij = ith bit in jth block ⊕ = XOR operation
To improve matters, one typically performs a one-bit circular shift, or rotation, on the hash value after each block is processed.
Message authentication protects two parties who exchange messages from any third party. However, it does not protect the two parties against each other. Digital signatures work best in public-key cryptography and an approach to generate these signatures was discussed in Lecture 9 in the context of public- key cryptography. I would also like to add here that the actual digital signature algorithm (DSA) (which you used in Lab 4 in ssh with public key authentication) is based on the difficulty of computing discrete logarithms (schemes originally presented by ElGamal and Schnorr); I have a link to the DSA algorithm on the course webpage. This is a competitor to the RSA public-key cryptosystem we discussed in Lecture 9, which was based on the difficulty of factoring large numbers. It is difficult/perhaps downright impossible to have digital signatures in symmetric-key cryptography without third party intervention. So, along with the distribution of the symmetric key, this remains one of the advantages of public-key cryptography over symmetric-key cryptography.
There are two views about network security; the first is one known as end-to-end (application layer security), where the two end-to-end processes (communicat- ing parties) do the necessary encryption and decryption; any tampering done in between these two processes including within either operating system can then be detected. The trouble with this approach is that it requires changing all the applications to make them security aware. In this view, the next best approach is putting encryption between the application layer and the trans- port layer, making it still end-to-end, but not requiring the applications to be changed. Another trouble is that the IP headers in this approach cannot be encrypted, else the intermediate routers will not be able to see the plain IP headers for routing purposes. Thus, even if the eavesdropper cannot see the actual data, he/she can perform a traffic analysis based on the values in the IP header. The opposite view is that the network layer should do the necessary encryption/decryption (link level security). in this case each vulnerable commu- nications link is equipped on both ends with an encrypting device. Thus, traffic over all communicating links is secured. Although this recourse requires a lot of
The complete IPsec design is a framework for multiple services, algorithms and granularities. The reason for multiple services is that not everyone wants to pay the price for having all the services all the time. The major services are secrecy, data integrity, and protection from replay attacks (where an intruder replays an earlier conversation). All of these services are based on symmetric- key cryptography because high performance is crucial. Moreover, the reason for multiple algorithms is that the security algorithm (that is now thought be secure) may be broken in the future. By making IPsec algorithm independent, the framework can survive even if the algorithm does not. Finally, the reason for having multiple granularities is to make it possible to protect a single TCP connection, all traffic between a pair of hosts etc. An important aspect of IPsec is that even though it is in the IP layer, it is connection oriented. However, this is not surprising, since the security protocol involves setting up a session key which is used for some period of time, so some sort of connection needs to be set up. A connection in the context of IPsec is called an SA (security association). IPsec can be operated in two modes: a transport mode in which the IPsec header is added just after the IP header. The protocol field in the original IP header is changed to indicate that an IPsec header follows the normal IP header. The IPsec header contains security information, primarily the SA identifier, a new sequence number, and possibly an integrity check on the payload. In the tunnel mode, the entire IP packet, header and all, is encapsulated in the body of a new IP packet with a completely new IP header. Here is an example of how the tunnel mode IPsec operates: Host A on a network generates an IP packet with the destination address of host B on another network. This packet is routed from the originating host to a firewall (secure router) at the boundary of A’s network. The packet is transmitted in the clear until it reaches this firewall. The firewall filters all outgoing packets to determine the need for IPsec processing. If the packet from A to B requires IPsec, the firewall performs this processing and encapsulates the resulting packet with an outer IP header. The source IP address of this outer IP packet is this firewall, and the destination address may be a firewall that forms the boundary to B’s local network. This packet is now routed to B’s firewall, with the intermediate routers examining only the outer IP header. At B’s firewall, the outer IP header is stripped off, and the inner packet is delivered to B. There are two protocols within IPsec: AH (Authentication Header) and ESP (Encapsulating Security Payload). AH only provides authentication, whereas ESP provides both authentication and encryption. The header employed in the AH protocol (in transport mode) is shown in Figure 7. As shown in this figure, the header consists of the following fields:
IP header AH
32 Bits
Security parameters index
Next header Payload len (Reserved)
Sequence number
Authentication data (HMAC)
TCP header
Authenticated Payload + padding
ESP header
New IP header
Old IP header
TCP header
Authenticated
(b) Payload + padding Authentication (HMAC)
ESP header
IP header
TCP (a) (^) header Payload + padding Authentication (HMAC)
Authenticated
Encrypted
Encrypted
MD5 RSA Zip IDEA Base 64
RSA
ASCII text to P1.Z^ the network P
P
Original plaintext message from Alice
Concatenation of P and the signed hash of P
Concatenation of P1.Z encrypted with IDEA and KM encrypted with EB
Alice's private RSA key, DA
P1 compressed
Bob's public RSA key, EB
KM : One-time message key for IDEA : Concatenation
KM