Security
Security
Chapter 21:
Security
Learning objectives
By the end of this chapter you should be able to:
■ show understanding of how encryption works
■ show understanding of digital certification
■ show awareness of the Secure Socket Layer (SSL)/Transport Layer Security (TLS) protocols.
Part 3: Chapter 21: Security
Key Key
KEY TERMS
Security concerns
There are a number of security concerns relating to a transmission.
• Confidentiality: Only the intended recipient should be able to decrypt the ciphertext.
• Authenticity: The receiver must be certain who sent the ciphertext.
• Integrity: The ciphertext must not be modified during transmission.
• Non-repudiation: Neither sender nor receiver should be able to deny involvement in
the transmission.
• Availability: Nothing should happen to prevent the receiver from receiving the transmission.
This chapter will consider only confidentiality, authenticity and integrity.
The confidentiality concern arises because a message could be intercepted during
transmission and the contents read by an unauthorised person. The concern about integrity
reflects the fact that the transmission might be interfered with deliberately but also that
there might be accidental corruption of the data during transmission.
Encryption methods
The fundamental principle of encryption is that the encryption algorithm must not be
a secret: it must be in the public domain. In contrast, an encryption key must be secret.
Cambridge International AS & A Level Computer Science
However, there are two alternative approaches. One is symmetric key encryption, and the
other is asymmetric key encryption also known as public key encryption.
KEY TERMS
Symmetric key encryption: one private key is held by both sender and receiver and is used for both
encryption and decryption
Asymmetric key encryption: there is a public key and a private key one of which is used for
encryption and the other for decryption
In symmetric key encryption there is just one key. This key is a secret shared by the sender
and the receiver of a message. The sender uses the encryption algorithm together with the
key to encrypt some plaintext. The receiver decrypts the ciphertext using the same key.
The issue with symmetric key encryption is delivery of the secret key. The sender needs the
key to encrypt but how can the key be securely delivered to the receiver to allow decryption?
In asymmetric key encryption two different keys are used, one for encryption and the other
one for decryption. Only one of these is a secret.
If asymmetric encryption is to be used the process is initiated by someone in possession of
two keys. One of these is a public key which is sent to anyone who is going to partake in an
encrypted communication. The other is a secret private key which is never sent to anyone.
Having a means of secure transmission of a secret key is no longer an issue.
The most likely scenario is that the holder of the two keys wishes to receive a transmission. In
388 this case a sender uses the public key to encrypt some plaintext and sends the ciphertext to
the receiver. The receiver is now the only person who can decrypt the message because the
private and public keys are a matched pair. The public key can be provided to any number of
different people allowing the receiver to receive a private message from any of the different
people. There are two points to note here.
• If two people require two-way communication, both communicators need a private key
and must send the matching public key to the other person.
• There are two requirements to ensure confidentiality should the transmission be
intercepted and the message extracted: the encryption algorithm must be complex and
the number of bits used to define the key must be large.
Question 21.01
One method used by an unauthorised person attempting to decrypt a message is called a
brute-force attack where all possible values for the key are tried. Calculate how long it would
take to try all possibilities for a 64-bit or 128-bit key, assuming each attempt took 1 second.
The above account does not completely answer the question of how encryption works.
The missing factor is an organisation to provide keys and to ensure their safe delivery to
individuals using them. This will be discussed in the next section.
confidential because anyone might be in possession of the public key. However, it could be
used if it was important to verify who the sender was. Only the sender has the private key
and the public key only works with that one specific private key. Therefore, if the recipient
finds that the decryption is successful, the message has in effect been received with a digital
signature identifying the sender.
Cryptographic
Message hash Digest
function
Figure 21.02 Sender using a one-way hash function to send a digital signature
The processes that take place at the receiver end are outlined in Figure 21.03. The same
public one-way hash function is used to create a digest from the received message. Then the
encrypted version of the original digest is decrypted using the public key.
If the two digests are identical the receiver can be confident that the message is authentic
and has been transmitted unaltered.
Note that the digital signature is different each time this process is used. This is because the
digest is uniquely defined by the hash function being applied to that particular message.
Cryptographic
Message hash Digest
function
Digital
Decryption Digest
signature
Sender’s
public key
Figure 21.03 Receiver checking that the received transmission is authentic and unchanged
Cambridge International AS & A Level Computer Science
However, the authenticity only confirms to the receiver that the message was sent from the
person who had sent them the public key. It does not consider the fact that someone might
create a public key and pretend to be someone else.
Therefore, a more strict way of ensuring authentication is needed. This can be provided by a
Certification Authority (CA) as part of a Public Key Infrastructure (PKI).
Certification
Person A Person A’s public key Authority
(the receiver) (CA)
Let’s consider a would-be receiver who has a public–private key pair. The receiver wants to
be able to receive secure messages from other individuals, and these individuals want to be
confident about the identity of the receiver. The public key must be made available in a way
390
that ensures authentication. The steps taken by the would-be receiver to obtain a digital
certificate to allow safe public key delivery are illustrated in Figure 21.04. The process can be
summarised as follows.
1 An individual (person A) who is a would-be receiver and has a public–private key pair
contacts a local CA.
2 The CA confirms the identity of person A.
3 Person A’s public key is given to the CA.
4 The CA creates a public-key certificate (a digital certificate) and writes person A’s public
key into this document.
5 The CA uses encryption with the CA’s private key to add a digital signature to this document.
6 The digital certificate is given to person A.
7 Person A posts the digital certificate on a website.
Figure 21.04 shows person A placing the digital certificate on that person’s website but another
option is to post it on a website designed specifically for keeping digital certificate data.
Anyone who wishes to extract the public key from the certificate has to use the CA’s public key.
For this overall process to work there is a need for standards to be defined regarding the
public key infrastructure and the production of the digital certificate. As ever, the name for
the standard, X.509, is not very memorable.
TIP
There are two similar processes that have been discussed. In one case someone with a private key
sends a public key to someone else. In another case the CA sends a digital certificate containing a
public key. Try not to confuse these two.
Part 3: Chapter 21: Security
The AES standard defines the block length as 128 bits. The user can choose to use 128, 192 or
256 bits for the key. The chances of the key being identified from the transmitted ciphertext
are small. The main concern is the safety of the method used to provide the key to both
sender and receiver.
The use of encryption has always been a controversial subject. There are two important
aspects to this. The first is whether powerful, unbreakable encryption algorithms should be
made available to the public. The second relates to the key escrow scheme, which allows
governments access to all secret keys. You might wish to consider how the content here has
relevance to some of the topics in Chapter 9 and Chapter 10.
=1 = 0 = 1 =0
This scheme can be used to enable a sender and receiver to create a ‘shared secret’ code
consisting of a number of bits. Table 21.01 illustrates the process.
Cambridge International AS & A Level Computer Science
TASK 21.01
The concept of a ‘shared secret’ has been used in traditional encryption schemes.
An example is the Diffie–Hellman key agreement method. Investigate the principles
behind how this works.
Reflection Point:
Chapter 21: Security has some difficult concepts. Have you made sure that you understand
the overriding principles and definitions used?