INF 311 - Lecture 4
INF 311 - Lecture 4
4
Introduction
• If we regard shared resources as objects, then the
requirement is to protect any processes that
encapsulate shared objects and any
communication channels that are used to interact
with them against all conceivable forms of attack.
• In the physical world, organizations adopt
security policies that provide for the sharing of
resources within specified limits.
– For example, a company may permit entry to its
buildings only to its employees and accredited visitors.
• Security policies are enforced with the help of
security mechanisms.
Security
• Security can be defined as the
“mechanisms and techniques that
control who may use or modify the
computer or the information stored in
it”.
8
Classes of Security Threats
Security threats fall into three
categories
• Leakage: Refers to the acquisition
of information by unauthorized
recipients
• Tampering: Refers to the
unauthorized alteration of
information
• Vandalism:The intentional act of
disrupting or damaging a system, network, or
Methods of Attack
• Eavesdropping
– Obtaining copies of messages without
authority.
• Masquerading
– Sending/receiving messages using the
identity of another principal without
their authority.
• Message Tampering
– Intercepting and altering messages
before passing them on to the intended
recipient.
Methods of Attack
• Replaying
– Intercepting, storing and replaying messages.
– Storing intercepted messages and sending
them at a later date.
– This attack may be effective even with
authenticated and encrypted messages.
• Denial of Service (DoS)
– Flooding a channel with requests to deny
access to others.
– Flooding a channel or other resources with
messages in order to deny access for others.
Methods of Attack
• DoS: A form of attack in which the enemy
interferes with the activities of authorized
users by making excessive and pointless
invocations on services or message
transmissions in a network, resulting in
overloading of physical resources (network
bandwidth, server processing capacity).
• Such attacks are usually made with the
intention of delaying or preventing actions
by other users.
Threats from Mobile Code
• Mobile code (Java JVM)
– Applets, mobile agents (travel collecting information)
– Downloaded from server, run locally
• Security issues: what if the program...
– Illegally writes to a file?
– Writes over another program’s memory?
– Crashes?
• Some solutions
– Stored separately from other classes
– Type-checking and code-validation (instruction subset)
– Still does not guard fully against programming errors...
Designing Secure Systems
• Security is about avoiding disasters
and minimizing mishaps, although
the design of secure system remains
an inherently difficult task but the
designer’s aim is to exclude all
possible attacks and loophole.
• The design of secure system is an
exercise in balancing costs and
threats
Designing Secure Systems
• The range of techniques that can be
deployed for protecting processes and
securing inter-process communication is
strong enough to withstand almost any
attack, but their use incurs costs and
inconvenience.
• The cost must be balanced against the
threats.
• Inappropriately specified security measures
may exclude legitimate users from
performing necessary actions.
Overview of Security Techniques
• Cryptography
• Authentication
• Digital Signature
• Certificates
• Access Control
• Credentials
• Firewalls
Cryptography
• The science of how to prepare encoded
information
• It is the process of encoding a message in
such a way as to hide its contents.
• Modern cryptography includes several
secure algorithms for encrypting and
decrypting messages
• They are all based on the use of secrets
called KEYS.
Cryptography
• A cryptographic key is a parameter
used in an encryption algorithm in
such a way that the encryption
cannot be reversed without
knowledge of the key.
• There are two main classes of
encryption algorithm in general use.
– shared secret keys(Symmetric Cryptography)
– the sender and the recipient must
share the key and it must not be
18
revealed to anyone else.
Cryptography
• AlgorithmAsymmetricCryptography
public/private key pairs the sender
uses a public key – one that has
already been published by the
recipient – to encrypt the message.
• The recipient uses a corresponding
private key to decrypt the message.
• Although many principals may
examine the public key, only the
recipient can decrypt the message,
because they have the private key.
3rd
• Hashing: Cryptographic hash functions take
input data and produce a fixed-size string of
characters, which is typically used to verify
data integrity. For example, SHA-256 is a
commonly used hashing algorithm in
blockchain and other security mechanisms.
20
Authentication
Authentication
• Authentication is the process of verifying the identity of an entity
(user, device, or system) to ensure that they are who they claim
to be.
• Password-based Authentication: A user provides a password,
which is compared against a stored hash of the password. The
system only allows access if the hashes match.
• Multi-Factor Authentication (MFA): This involves two or more
forms of verification before granting access, such as something
you know (password), something you have (a mobile phone), or
something you are (biometric data).
• Public Key Authentication: In public key authentication (such as
SSH), a user proves their identity using a private key, and the
system verifies it with the corresponding public key.
Digital Signature (DS)
• Is a mathematical technique used to
validate the authenticity and
integrity of a message, software or
digital document.
• Service control:
– filter requests for services on internal
hosts
– e.g. reject HTTP request unless to official
web server
• A firewall is a network security device that monitors and filters
incoming and outgoing network traffic based on predefined security
rules. It serves as a barrier between trusted internal networks and
untrusted external networks, such as the internet.
• Types of Firewalls:
– Packet Filtering Firewall: Examines network packets to see if they match a
set of predefined rules (e.g., IP addresses, ports, and protocols). This is a
simple and fast type of firewall.
– Stateful Inspection Firewall: Keeps track of the state of active connections
and makes decisions based on the context of traffic, rather than just
inspecting individual packets.
– Proxy Firewalls: Acts as an intermediary between users and the services
they wish to access, forwarding requests and responses, often with
additional security checks.
– Next-Generation Firewalls (NGFW): Combines traditional firewall features
with advanced capabilities such as deep packet inspection (DPI), intrusion
detection and prevention (IDPS), and application awareness.
• Use Cases: Firewalls are deployed at the boundaries of networks to
block unauthorized access, monitor for malicious activity, and 37
Firewalls
• Behaviour control
– prevent illegal or anti-social behaviour
– e.g. filter ‘spam’ messages
• User control
– allow access to authorised group of
users
– e.g. dial-up services
38
Summary
Each of these components plays a crucial role in securing
distributed systems:
• Cryptography protects data confidentiality and integrity.
• Authentication ensures that only legitimate users or systems
gain access.
• Digital Signatures guarantee the authenticity and integrity of
messages.
• Certificates provide trust and secure key management in
Public Key Infrastructure (PKI).
• Access Control ensures that only authorized entities can
access resources or perform actions.
• Credentials are used for identity verification and authorization.
• Firewalls prevent unauthorized access and attacks by
monitoring and controlling network traffic 39
Cryptographic Algorithms
• Art of hiding information.
• Art of achieving security by encoding
messages to make them unreadable.
• Study of mathematical techniques related
to the aspect of information security such
as confidentiality, data integrity,
authentication and data origination.
• Science of using mathematics to encrypt
and decrypt data.
E.g.
• JLYHWZRPLOOLRQ
Cryptography
• Kryptos(hidden)+graphein(to write) =
secret writing
– Conceals messages from unauthorized
persons (secrecy + privacy)
– Verifies correctness of message and
authenticates to other party (integrity +
authentication )
Terminologies
• Plain text- original message
• Cipher text-coded message
• Cipher-algorithm for transforming plain text to
cipher text
• Key- info used in cipher known only to
sender/receiver
• Encrypt(encipher)-converting plain text to
cipher text using the key
Terminologies
• Decrypt (decipher)- recovering plain text from cipher
text using the key
• Cryptography- study of encryption
principles/methods
• Cyrptanalysis (code breaking)- study of
principles/methods of deciphering cipher text
without knowing the key
• Cryptology = cryptography + cryptanalysis
• Cryptosystem- a system for encryption and
decryption
Conventional Encryption Principles
45
Conventional Encryption Principles
46
Cryptography
• Classified along three independent dimensions:
– The type of operations used for transforming
plaintext to ciphertext (substitutions and
transpositions)
– The number of keys used
• symmetric (single key)
• asymmetric (two-keys, or public-key encryption)
– The way in which the plaintext is processed (block
cipher and stream cipher)
47
Classifications of Cryptosystems
• Symmetric Cryptosystems
• Asymmetric Cryptosystems
Symmetric Cryptosystems
• Same key is used for both encryption and
decryption purposes
• All classical encryption algorithms are private-
key
• Was only type prior to invention of public-key
in 1970’s
• And by far most widely used
– E.g. Data Encryption Standard (DES)
• Problem: How to distribute the key securely?
Symmetric or Secret/Single Key
Symmetric Contd..
• Strength
– Simple and fast
• Weakness
– Must agree the key beforehand
– Securely pass the key to the other party
– The key must remain secret at both ends
Asymmetric/Public Key Cryptosystems
• Weakness
– Susceptible to “known ciphertext” attacks
Classical Ciphers
• Substitution Ciphers
– Letters of the plaintext messages are
replaced with other letters during
encryption
• Transposition Ciphers
– The order of plaintext letters is rearranged
during encryption
Substitution Ciphers
• Monoalphabetic Cipher
– Caesar Cipher
• Polyalphabetic Cipher
– Vigenere Cipher
• Multiple Letter Cipher
– Playfair Cipher
• Note: We will cover only Caesar Cipher (in this
course)
Caesar Cipher
• Earliest known substitution cipher
• by Julius Caesar
• First attested use in military affairs
• Replaces each letter by 3rd letter after it in the
alphabet
• Example:
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
Cryptanalysis of Caesar Cipher
• Only have 26 possible ciphers
– A maps to A,B,..Z
• Could simply try each in turn
• A brute force search
• Given ciphertext, just try all shifts of letters
• Do need to recognize when have plaintext
– E.g. break ciphertext "GCUA VQ DTGCM"
Monoalphabetic Cipher
• Rather than just shifting the alphabet, shuffle
(jumble) the letters arbitrarily.
• Each plaintext letter maps to a different
random ciphertext letter.
• Hence key is 26 letters long
– Plain : abcdefghijklmnopqrstuvwxyz
– Cipher:
DKVQFIBJWPESCXHTMYAUOLRGZN
Drawback: key is too complicated to be remembered
Keyword Cipher
• There will be many keys but still easy to remember
73
Block Ciphers
The key characteristics of a block cipher are:
• Block Size: It encrypts data in fixed-size blocks (e.g., 64 or 128
bits).
• Key Size: Uses a secret key for both encryption and decryption,
with the strength depending on key length (e.g., 128, 192, or
256 bits).
• Symmetric Encryption: The same key is used for both
encryption and decryption.
• Modes of Operation: Techniques like ECB(Electronic
Codebook) , CBC(Cipher Block Chaining, and CTR(Counter
Mode) are used to encrypt data larger than a single block, each
with varying security and performance trade-offs.
74
Block Ciphers
Block Ciphers
• Advantages
– High diffusion-info from plaintext is diffused
into several ciphertext symbols.
– Immunity to insertion of symbols-it is
impossible to insert a single symbol into a
block
Block Ciphers
• Disadvantages
– Slowness of encryption- has to wait for the
entire block of symbols to arrive before
starting the encryption process
– Require more memory
– Error propagation- error affects all other
characters in the block
Thank You!
78