Introduction To Computer Security
Introduction To Computer Security
Computer Security
Lecture – 4
Alice Bob
Eve 38
EncryptionEncryption and Decryption
• TheM
• The message message
is calledMthe
is called the plaintext.
plaintext
• Alice will• convert
Alice willplaintext
convert Mplaintext M to an encrypted
to an encrypted form using an
encryptionformalgorithm
using anE that outputsalgorithm
encryption a ciphertext C for M
E that
outputs a ciphertext C for M.
Communication
Sender Recipient
channel
encrypt decrypt
ciphertext plaintext
plaintext
aint
int x
shared shared
secret secret
key key
Attacker 39
(eavesdropping)
Encryption
• As equations:
• C = E(M), M = D(C)
• The encryption and decryption algorithms are chosen so that it is infeasible for
someone other than Alice and Bob to determine plaintext M from ciphertext C
• Thus, ciphertext C can be transmitted over an insecure channel that can be
eavesdropped by an adversary
• The decryption algorithm must use some secret information known to Bob, and
possibly also to Alice, but no other party
• using an auxiliary input a secret number or string called decryption key
• the decryption algorithm itself can be implemented by standard, publicly available software
and only the decryption key needs to remain secret
• Similarly, the encryption algorithm uses as auxiliary input an encryption key,
which is associated with the decryption key
• If it is feasible to derive the decryption key from the encryption key, the
encryption key should be kept secret as well
Cryptosystem
• A cryptosystem consists of seven components:
• The set of possible plaintexts
• The set of possible ciphertexts
• The set of encryption keys
• The set of decryption keys
• The correspondence between encryption keys and decryption keys
• The encryption algorithm to use
• The decryption algorithm to use
3. The set of encryption keys
4. The set of decryption keys
5. The correspondence between encryption
keys and decryption keys
Cryptosystem: Caesar cipher 6. The encryption algorithm to use
7. The decryption algorithm to use
41
Attacker
(eavesdropping)
43
n !n"1 #$2
parties to share a (separate) secret key keys
• If there are n parties, it means it requires a shared
secret
44
Public-Key Cryptography
• Bob has two keys: a private key, SB, which Bob
keeps secret, and a public key, PB, which Bob • Separate keys are used for encryption and
broadcasts widely decryption.
Communication
plaintext
plai
int x
ciphertext plaintext
public public
n key
pairs
public public
private private
47
Combining symmetric and public key systems
• The main disadvantage of public-key cryptosystems is that they are
much slower than existing symmetric encryption schemes
• Hence, public-key cryptography is unsuitable for interactive sessions that use
a lot of back-and-forth communication
• Also, public-key cryptosystems have larger key lengths than that for
symmetric cryptosystems
• For example, RSA is commonly used with 2,048-bit keys while AES is typically
used with 256-bit keys
Also, public-key cryptosystems require in practice a key length that is
one order of magnitude larger than that for symmetric cryptosystems. For
example, RSA is commonly used with 2, 048-bit keys while AES is typically
used with 256-bit keys.
Combining symmetric and public key systems In order to work around these disadvantages, public-key cryptosystems
are often used in practice just to allow Alice and Bob to exchange a shared
secret key, which they subsequently use for communicating with a symmet-
ric encryption scheme, as shown in Figure 12.
encryptt d
decrypt
t
• public-key cryptosystems are often secret
k
key ciphertext
secret
key
used in practice just to allow Alice
and Bob to exchange a shared secret public key private key
key shared
h d shared
h d
secret key Attacker secret key
plaintext M plaintext M′