Computer Security SEHS4515: Understanding Core Security Principles
Computer Security SEHS4515: Understanding Core Security Principles
SEHS4515
Lesson One
Note: Most of the teach materials has been taken from the lectures of Dr. Adam Wong
Assessment ? 50% Continuous Assessment
50% Examination
Continuous Assessment Percentage
Assignment(s) 25%
Participation** 10%
Examination 50%
Total 100%
* Mid-term test will include multiple choices, short questions and structured questions. The assignment will
be used to assess students’ ability to explain the use and design of policies and technologies for security
solutions.
** Participation is calculated based on the tutorial and in-classes exercises submitted
Text Book, Professional Exam
• The text book covers principles and practices that apply to most other
operating systems as well.
• Good for preparing for
• Microsoft Technology Associate (MTA)
• Exam 98-367 Security fundamentals
• Other references will be used whenever necessary
• CISSP® - Certified Information Systems Security Professional
Understanding Core
Security Principles
Understanding Core Security
Principles
• Every digital device presents a certain risk – Cannot be
eliminated
• Understanding core security principles – Guide the protection of
information technology system and data!
• Understanding risk
• Exploring the security triad – Confidentiality-Integrity-Availability (CIA)
• Implementing a defense-in-depth security strategy
• Enforcing the principle of least privilege
• Hardening a server
Understanding Risk
• Risk is unavoidable. You can't eliminate it. However, it's
possible to minimize risk by first understanding it and then
taking steps to mitigate it.
• Minimizing risk is also known as risk mitigation.
Understanding Risk
“Risk is a function of the likelihood/possibility such that a given threat may explore
vulnerability, and what could be the resulting impact of that adverse event on the
organization”
• It can be found in NIST's Special Publication 800-30 (SP 800-30), which is titled
"Risk Management Guide for Information Technology Systems."
Understanding Risk
• Risk occurs when threats exploit vulnerabilities.
Adversary, Attack and Countermeasure
• An adversary is an entity that attacks, or can cause a threat, to
a system.
• An asset is some valuable resource you are trying to protect.
• An attack is an attempt by an adversary to cause damage to
valuable assets, by exploiting vulnerabilities.
• A countermeasure is an action, device, procedure, or technique
that reduces a threat, a vulnerability, or an attack by preventing
it or by minimizing the harm that it may cause.
Threats
• A threat is a set of circumstances that could possibly
cause violation of rules or even damage.
• Man-made threats are any threats from people.
• Intentional threats
• These include theft, fire, vandalism, malware distribution, access,
modification, or deletion of data.
• Unintentional threats
• The accidental deletion of data because of carelessness.
• Natural threats include weather events such as
hurricanes, foods, tornadoes, and lightning.
• Environmental threats include long-term power
failures or the inadvertent release of hazardous
chemicals
Vulnerabilities
• Vulnerabilities are weaknesses.
• Vulnerabilities in your software or hardware:
• E.g. bugs in the code or faulty power supplies.
• Vulnerabilities in security configurations:
• E.g. Unneeded services or protocols are left running on a system.
• Vulnerabilities in physical security
• Unauthorized personnel access to servers or network devices.
https://www.youtube.com/watch?v=rwigKjEsdTc
Threats, Vulnerabilities, Security
Principle, Countermeasure
• Case 1
• Threat: Adversaries might install key loggers in the computers in our
Personnel Department for stealing business secrets.
• Vulnerability? Security Principle? Countermeasure?
• Case 2
• Threat: Thieves could break into our facility and steal our equipment.
• Vulnerability? Security Principle? Countermeasure?
• Case 3
• Threat: Employees (insiders) might release confidential information to our
competitors
• Vulnerability? Security Principle? Countermeasure?
Security Measures to Achieve CIA
(They will be covered later in the course)
• Confidentiality
• Access controls
• Encryption
• Availability
• Backups
• Fault tolerance and redundancies
• Integrity
• Access controls and audit logging
• Hashing algorithms
Defense-in-Depth Security Strategy
• It is a strategy employed by
security professionals that
includes multiple layers of
security.
The administrator
can choose which
group of computers
to apply the update.
Hardening a Server Enable Firewalls
• Since Windows XP Service Pack 2 (SP2) and Windows
Server 2008, the Windows Firewall is enabled by default.
• When you're hardening a server, it's important to ensure that a
host firewall is enabled.
Note: A host firewall is
installed on the client or
server. A network
firewall is installed at a
network boundary, such
as between the
Internet and an internal
network
Hardening a Server: Install and Update
Antivirus (AV) Software
• Antivirus (AV) software can detect and block known malware,
and it can often detect suspicious activities by unknown
malware.
• Malware can spread through email or through many other
methods such as USB drives or by visiting infected websites.
• AV signatures must be regularly updated.
Note: Different systems need
different protections. For
example, the AV software
installed on an email server is
different from AV software
you'd install on a database
server or an end user's
computer.
The Windows OS has more
vulnerabilities?
• Macs are so secure that antivirus software and updating aren't
needed? Not true.
• For example, in November 2010, Computerworld published an article titled
"Apple Smashes Patch Record with Gigantic Update“. It mentions that Apple
fixed 134 flaws with Mac OS X. Mac OS X is based on a version of Unix known
as Snow Leopard.
• More than 90 percent of the systems in use are Microsoft based, so Microsoft
systems get more press.
• The only way to ensure that an operating system stays as secure as
possible is to keep it current with system updates.
Today’s world is different!
• What is the most popular OS today?
• We have different markets
• For smartphones and other pocket-sized devices, Android leads with 73%
market share, and Apple's iOS has 27%.*
• For desktop and laptop computers, Windows is the most used at 75%,
followed by Apple's macOS at 16%, and Linux-based operating systems,
including Google's Chrome OS, at 5% (thereof "desktop Linux" at 2.35%).*
• With tablets, Apple's iOS has 55% and Android has 45%.*
*https://gs.statcounter.com/os-market-share#monthly-202012-202112-bar
Question
Note: Most of the teach materials has been taken from the lectures of Dr. Adam Wong
Understanding Malware
and Social Engineering
What will we learn today?
• The most common threats to computers is MALicious SoftWARE aka
MALWARE
• Comparing different malwares
• Protecting against malware
• Thwarting social engineering attacks
• Protecting emails
What is Malware?
• Malicious software (malware) is software that is installed
on a system without the user's knowledge or consent. It
includes:
• Viruses,
• Worms,
• Trojan horses,
• Spyware, and more.
• Malware attempts to gather as much data as possible,
and then attackers use that data for monetary gain. This
is sometimes done by stealing identities, stealing financial
data, and clearing out bank accounts.
• Sometimes attackers are willing to collect small amounts
of data at a time from millions of users. Another purpose
of malware is espionage—both corporate espionage and
government espionage.
Botnets and Malware
• Much of today's malicious software has the primary purpose of taking
over a computer and having it join a botnet (or roBOT NETwork). The
computers act as clones or zombies and do the work for the attacker.
• A server known as a command-and-control server controls the clones within a
botnet, and an attacker controls the server.
• Clones check in periodically with the command-and-control server for
instructions on what to do. They can be instructed to launch denial of service
(DoS) attacks or send massive amounts of infected spam. This is all completely
unknown to the user.
• The best protections are up-to-date and active AV software and educated
users.
https://www.youtube.com/watch?v=6V5BeXypd6U&t=163s
https://www.techtarget.com/searchsecurity/definition/botnet
Common Malware Types
• Note: Spam is unwanted or unsolicited email. It often includes malware as an
attachment, embedded scripts that can cause damage, or links to malicious
websites.
Understanding Malware
Viruses
• A computer virus is an executable program that spreads
with a computer or from one computer to another.
• One of the key functions of a virus is to replicate itself.
Damages that a virus can cause includes the following:
• Join your computer to a botnet
• Corrupt or delete data on your system
• Email itself to other computers using your address
list
• Erase everything on your hard disk
Understanding Malware
Virus Delivery Methods
• Attachment in Unwanted Email
• Spam is the most popular way to transmit viruses.
Such messages may look like greeting cards, audio
files, video files, or images. When the user double-
clicks the attachment to open it, the virus installs itself
on the computer.
• Script in Unwanted Email
• Some email messages have scripts embedded within
them. When the user opens the email, the script runs
and installs the virus.
• Some email programs (such as Microsoft Outlook)
block the scripts by default.
Understanding Malware
Virus Delivery Methods
• Installed on USB Drives
• Viruses sometimes look for a USB drive and automatically infect the
drive when it's plugged into a system. When the user inserts the drive
into another system, the virus infects this system too.
https://www.youtube.com/watch?v=oyUsZu6ygq8
Understanding Malware
Worm Spreading Methods
• Worms can spread themselves over the network through
one of several methods.
1.A worm can identify IP addresses of other computers on
the network and then look for open ports. When it finds an
exploitable port, it infects the other computer.
2.Worms can also read email addresses stored in a user's
address book and then send themselves via email.
• Because the worm spreads over the network, it has the
potential to slow down network performance. Some worms
food the network with so much traffic that the entire
network slows to a crawl.
Understanding Malware
Famous Worms
• Morris
• It exploited vulnerabilities in Unix programs, such as Sendmail and Finger, and cracked weak
passwords. It consumed system resources until eventually the infected system became
inoperable or simply crashed.
• Conficker
• It attacks unpatched Windows systems. It's estimated to have infected more than 7 million
computers, each of which is controlled in a massive botnet spread over 200 countries.
• Sasser
• The worm component searches for other systems on the network that have port 445 open and
then starts the buffer-overflow attack on this port. Infected systems randomly crash and reboot.
This worm has caused X-ray machines in a hospital to shut down
Understanding Malware
Trojan Horses
• Trojan horse malware is software that looks like one thing but is actually
something else.
• For example, a user may be enticed into downloading a game or utility. However, in addition
to the game or utility, the download includes malicious software embedded within it. When the
user installs the application, the Trojan horse is also installed.
Understanding Malware
Trojan Horses
• A popular type of Trojan horse today
is rogueware.
• Rogueware is a fake program that
advertises a specific function, such as
AV. The program will alert the user that
their computer is infected and will then
ask for payment in order to remove the
threat. The program's intention is to
solicit the payment, and whether or not
a threat exists on the machine is never
actually checked.
Understanding Malware
Trojan Horses
• If the user clicks the Scan System Now button
shown in the figure, it starts the download and
installation of the malicious software.
• Some rogueware confuses the user by using
names that are similar to genuine software from
reputable companies. For example, one version of
rogueware is named Security Essentials 2010. This
isn't the valid Microsoft Security Essentials program
created and published by Microsoft.
• The attackers are sophisticated and create
very realistic-looking programs. The best
defenses are up-to-date AV software from a
reliable source and educated users.
Understanding Malware
Buffer-overflow attacks
• Buffer-overflow attacks take advantage of known
vulnerabilities/Weakness within operating systems and
applications.
• Applications use areas of memory (buffers) to store temporary data.
For example, when you fill out a form on a web page, your
information is stored temporarily in a program buffer.
• When attackers discover data that causes a buffer overflow, they then add code to the
end of the data. This data causes the buffer overflow, and their code is inserted into the
exposed memory. In other words, they write malicious code and insert it into the system.
Understanding Malware
Countermeasure against buffer-overflow attacks
• Input Validation
• The application developer should validate all data
before using it.
• For example, if a number between 1 and 100 is
expected, the program should verify that the inputted
data is a valid number between 1 and 100.
• Application Testing
• For example, if a number between 1 and 100 is
expected, the numbers 0, 1, 2, 99, 100, and 101 are
entered to see how the program handles data at the
edge of accepted input.
• Up-to-Date Patching
• When buffer-overflow vulnerabilities are discovered,
the vendor or application developer typically releases a
patch to correct the problem. Of course, this patch is
only useful if it's applied.
Understanding Malware
Spyware
• Spyware is software that installs itself on a system without
the user's consent, or without giving the user any notice or
control. Spyware may not display any symptoms because
it's largely passive. It sits in the background collecting
information and doesn't want to be discovered.
https://www.youtube.com/watch?v=ZgXw3WCNXc8&list=PL5OdmBrO1Lpl8He9T19jKsWLUKiFIIkYc&index=52
Understanding Malware
Spyware Example: Keylogger
• A keylogger is a program that records all
keystrokes on a system. The keystrokes
are recorded into a log, which the attacker
later views. The log includes everything
that a user types, including URLs,
usernames, and passwords.
https://www.youtube.com/watch?v=L8169DHNeQ0&list=PL5OdmBrO1Lpl8He9T19jKsWLUKiFIIkYc&index=40
https://www.mdpi.com/1424-8220/20/11/3015/htm
Understanding Malware
Malware Example: Stuxnet
• It is the first known malware that has shown it is capable of having an
impact on industrial control system hardware. Stuxnet has successfully
penetrated even networks that are isolated from the Internet.
• Stuxnet doesn't damage the Windows systems but instead uses a worm
component to seek out a specific type of hardware.
• Then the attacker can connect a wireless access point to capture all the traffic
going through network devices in the wiring closet. He can then sit in a
parking lot next door with a wireless sniffer and capture data sent through the
network.
Social Engineering Attacks
Social Engineering with a Phone Call
• An attacker can call the help desk, identify herself as an executive in the
company by name, and then say that she's forgotten her password.
• Important procedures to consider:
• Verifying Identity Prior to Resetting Passwords
• A verification process can be used, requiring some type of identity proofing before
the password is reset. For example, users may be required to provide specific
information that isn't publically available.
https://www.youtube.com/watch?v=LrFarFrzbD4&list=PL5OdmBrO1Lpl8He9T19jKsWLUKiFIIkYc&index=51
Social Engineering Attacks
Phishing email with masked URL
• A masked web address is a web link that looks like one address
in plain text, but hovering over it shows that the actual link goes
somewhere else on the Internet.
Social Engineering Attacks: Spoofing e-mail
addresses
• Email spoofing changes the email message so that the To address
makes it appear as if the email is coming from someone other than
the actual sender.
• A phishing email may appear to come from your ISP and asks you to
validate your email account. It could look something like this:
An e-mail from YAHOO.com.hk
Your mailbox has exceeded the quota set by your administrator. This
quota can be increased, but to ensure that your account has not
been taken over by spammers, you will need to validate your
account.
To validate your account, reply to this email with the following
information:
Email address: 4
Password:
Date of birth:
If you fail to validate your account, your account will be
deactivated permanently.
Thank you for your prompt attention in this matter.
Social Engineering Attacks: Spoofing e-mail
addresses
• If you click Reply on a spoofed email address, you'll see that the Reply
To address is different.
• However, attackers sometimes use typo-squatting techniques to make
the address look similar, but not quite the same.
• microsft.com (without the second o)
• mircosoft.com (with the r and c transposed)
• validate-microsoft.com
• Spear phishing is another variant of phishing. The sender's address is
forged so that it appears to come from someone within the
employee's organization.
Thwarting Social Engineering Attacks
• Never Send a Password to a Company Through Email
• Legitimate companies will never request your credentials through email.
is disabled.
Social Engineering Attacks: Protecting E-mail
• Disable Automatic Display of Pictures
• This blocks images used as web beacons.
• An image used as a web beacon isn't sent in the email but is instead retrieved
from a web server using a link within the email. Embedded in the link is a
code that identifies the recipient's email address.
• When the server receives a request for the image, the web beacon identifies
the recipient's email address as a valid email address. Attackers sell valid
email addresses to other spammers, so the result of displaying images
automatically is more spam for the recipient.
• User Education
• The best protection from phishing attacks are educated users. When users
understand the scams, they're better able to detect them.
https://www.youtube.com/watch?v=n8mbzU0X2nQ&t=93s
Social Engineering Attacks: Protecting E-mail
• Understanding the threat
• 89 percent of all email is spam
• Approximately 5 million active botnets
• Over 339,600 strains of malware were detected in email
• Approximately 95.1 billion phishing emails in 2010
• Tracked phishing attacks impersonated more than 1,500 different
organizations
https://purplesec.us/resources/cyber-security-
statistics/#:~:text=98%25%20of%20cyber%20attacks%20rely,as%20being%20at%20high%20risk
Summary
• Malware • Social Engineering
ü Virus ü In Person
ü Worm ü Phone Calls
ü Trojan Horses ü Phishing
ü Buffer overflow ü Masked URL
ü Spyware ü E-mail Spoofing
ü Pharming
ü Host File
ü DNS Server
ü DNS Cache Poisoning
Reading:
ü Microsoft Windows Security: Essentials by Darril Gibson, Sybex, 2011 (Available via Books24x7.com)
Ø Chapter 2 (Second half)
Ø Chapter 10 (First half)
Movies
• The Imitation Game – About Sir Allan Turing Life’s and Work of
breaking of Enigma Machine (Father of computers and Information
Security)
• More movies – Check it out
• https://cybersecurityventures.com/movies-about-cybersecurity-and-
hacking/
Computer Security
SEHS4515
Lesson Three
Enforcing Confidentiality with Symmetric
Encryption
Enforcing Confidentiality with Asymmetric Encryption
Dr. Umair Mujtaba Qureshi
Note: Most of the teach materials has been taken from the lectures of Dr. Adam Wong
Enforcing Confidentiality with
Symmetric Encryption
Topic
• Confidentiality with encryption
• Ancient ciphers
• Scytale
• Caesar cipher
• Ciphering the data – Safety concern
• Modern ciphers
• Symmetric ciphers
• Common symmetric ciphers
• Problems with symmetric ciphers
• Asymmetric ciphers
• Asymmetric encryption and decryption
• RSA encryption and decryption example
• Asymmetric Encryption:
Session Key – Symmetric Encryption + Asymmetric Encryption
• Asymmetric Encryption: Securing Email
Confidentiality & Encryption
• Confidentiality ensures that unauthorized individuals are not able to
access the data. One of the methods used to prevent the loss of
confidentiality is encryption & decryption = cryptography.
• Importance of cryptography: https://www.youtube.com/watch?v=aOdxWtqibCI
https://www.youtube.com/watch?v=xT4_IRO-iRA
https://www.youtube.com/watch?v=Kf9KjCKmDcU
Confidentiality & Encryption
• Confidentiality ensures that unauthorized individuals are not able to
access the data. One of the methods used to prevent the loss of
confidentiality is encryption.
• Encryption scrambles data so that unauthorized users are unable to
read it.
• Most encryption includes an algorithm and a key.
• The algorithm provides a mathematical formula that identifies how data is to be
encrypted.
• The key is a number that provides randomization for the encryption.
• Most encryption algorithms are in one of two categories: symmetric
and asymmetric. Hash functions provide one-way encryptions of data.
• Each method is discussed in the following sections.
Ancient Encryption: Simple Ciphers
• Scytale cipher
• One of the ancient ciphers – Used by Spartans!
• Method: Keywords are broken into letters, written on
the a strip of paper (in those days on leather) by
wrapping it around a tree branch
• Example
Video: https://www.youtube.com/watch?v=nikWSEjFCWg
Is Encrypted Data Safe from
Attackers?
• Given enough time and resources, attackers can decrypt data even if
they don't know the correct key.
• One of the goals of encryption is to make this sufficiently difficult that
it isn't worthwhile to the attacker.
• You can ensure that it costs more money than the data is worth, or
ensure that it simply takes too long.
• Think of data encrypted on the Internet, such as your credit- card
number. If an attacker devoted millions of dollars to discover the key
and get your credit information, they still wouldn't be able to discover
the key in their lifetime. And by the time that single key was
discovered, the credit card would most likely no longer be valid.
Cryptography terms
• Cryptography: Cryptography is a method of using advanced mathematical
principles and storing and transmitting data in a particular form so that only
those whom it is intended can read and process it.
• Encryption is a key concept in cryptography as a process whereby a message is
encoded in a format that can not be read or understood by an eavesdropper.
• Encryption: Encryption is a process of encoding (or locking) a message or an
information by using cryptographic techniques in such a that only authorized
parties can access the information.
• Converts information from a plaintext into an encrypted ciphertext
• Decryption: Decryption is the process of decoding (or unlocking) encrypted
message or information using cryptographic techniques is called decryption
• Coverts encrypted ciphertext back into the form of plaintext and get the
message/information
Codes & Cipher
Codes Cipher
• A system that substitutes one • A system that uses mathematical
word or a phrase for another algorithm to encrypt and
decrypt messages
Symmetric Asymmetric
Symmetric Encryption
• It uses the same single key to encrypt and decrypt data. Both parties must
know what the symmetric key is, and this key must be kept secret from
other parties.
• The key provides a randomization factor for the ciphered text. When a different key
is used, the ciphered text is completely different.
Note: When a
strong encryption
algorithm is used,
an attacker can't
decrypt the data
without the key
within a reasonable
amount of time.
Symmetric Encryption
• The strength of encryption depends on the key length.
• If you use a key of 16 bits, there are only 65,536 i.e. (2^16=65536)
possible keys that can be used. With 256 bits used for the keys, there
are over 1.e+77 possibilities (1 followed by 77 zeroes!).
• End users don't often choose the encryption algorithm. Instead,
the encryption algorithm is selected by either the software or an
administrator.
Common Symmetric Encryption
Algorithms
• Data Encryption Standard (DES)
• An older encryption protocol, DES has been cracked and isn't recommended for
use. However, some legacy applications still use it.
• 3DES (Triple DES)
• Triple DES was introduced to improve DES. However, it's processor-intensive,
resulting in slow encryption and decryption times.
• International Data Encryption Algorithm (IDEA)
• IDEA was very popular for a period of time. But it's used less today, because newer
standards (such as AES) are more efficient.
• Blowfish and Twofish
• These are two other strong encryption algorithms that are being used less in favor
of the more efficient AES.
Symmetric Encryption: DES
• In the actual DES, the input is broken into
blocks of 64-bit
• There are 16 rounds of encryption, and a 56-
bit key is used from which sixteen 48-bit
sub-keys are calculated.
Symmetric Encryption:
Advanced Encryption Standard (AES)
• It is a very strong, efficient encryption algorithm and uses less computer
resources than other algorithms. It was selected by the National Institute of
Standards and Technology (NIST). It has been adopted by multiple public
sector organizations.
• Applications of AES
• Kerberos (the primary network-authentication protocol used in Microsoft's Active
Directory)
• WPA2 (a wireless encryption protocol)
• BitLocker and BitLocker To Go
• AES can use 128-bit, 194-bit, or 256-bit keys (known as AES- 256).
Symmetric Encryption:
How Strong is AES?
• Some early algorithms used 40 bits and could sometimes be cracked within a
week.
• If a cipher text which is created by AES using a 128-bit key, it's estimated that it
would take more than two million, million, million (2,000,000,000,000,000,000)
years to crack this key and then read the data. If an attacker invested millions in
multiple supercomputers and networked them together to crack a key, the time
might be reduced.
https://www.hypr.com/symmetric-key-cryptography/
OpenPGP
• OpenPGP is a non-proprietary protocol for encrypting email
communication using public key cryptography. It is based on the original
PGP (Pretty Good Privacy) software. The OpenPGP protocol defines
standard formats for encrypted messages, signatures, and certificates for
exchanging public keys.
• Beginning in 1997, the OpenPGP Working Group was formed in the
Internet Engineering Task Force (IETF) to define this standard that had
formerly been a proprietary product since 1991.
• As an IETF Proposed Standard RFC 4880, OpenPGP can be implemented
by any company without paying any licensing fees to anyone.
• The software GPG4Win can be downloaded free-of-charge from
www.gpg4win.de.
Enforcing Confidentiality with
Asymmetric Encryption
Asymmetric Encryption
• Asymmetric encryption uses two matched keys
• Also known as public-key encryption.
• It uses two matched keys, a public key and a private key.
• When public key encrypts data, only the private key can decrypt it.
• When private key encrypts data, only the public key can decrypt it.
☞ Asymmetric encryption
uses matched key pairs of a
public key and a private key.
These two keys work only
with each other.
Example of Asymmetric Encryption:
Can such keys exist in reality?
Asymmetric Encryption:
Common Algorithms
• Two common asymmetric encryption algorithms
• RSA
•Named after Rivest, Shamir, and Adleman, the three individuals who
first described it
• Diffie-Hellman
• Named after Diffie and Hellman
• Modern encryption is heavily based on mathematical theory.
• We will cover the basic mathematics that is used in the RSA aymmetric
encryption algorithm.
https://www.youtube.com/watch?v=AQDCe585Lnc
Random Number
• It is crucial to security that keys are generated with a truly random or
at least a pseudo-random generation process
• Otherwise, an attacker might reproduce the key generation process
and easily find the key used to secure a specific communication
Pseudo-random Number Generations
• A pseudo-random bit generator is an algorithm which, given a truly random
binary sequence of length k (“seed”), outputs a binary sequence of length
m >> k which “appears to be random ".
• The seed for pseudo-random number generators, may be based upon
processes as:
• The system clock
• Elapsed time between keystrokes or mouse movement
• Content of input/output buffers
• User input, and
• Operating system values such as system load and network statistics
Primes
• All integer numbers (except 0 and 1) are made up of primes.
• Prime numbers are integers that have divisors of 1 and itself. In other
words, they cannot be written as a product of other numbers.
• Facts about primes:
• 1 is prime, but is generally not of interest
• 2, 3, 5, 7 are prime
• 4, 6, 8, 9, 10 are not prime
• List of prime number less than 200 is: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107,
109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181,
191, 193, 197, 199
The Greatest Common Divisor (GCD)
• A common divisor of two integers a and b is a positive divisor of
both a and b.
• The Greatest Common Divisor (GCD) refers to the greatest of
all the common divisors of a and b, denoted by gcd(a,b)
Example: To find gcd(60, 24)
• Divisors of 60: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60
• Divisors of 24: 1, 2, 3, 4, 6, 8, 12, 24
• 60 and 24 have the common divisors 1, 2, 3, 4, 6, 12
• gcd(60, 24) = 12
Modular Arithmetic
• a mod n means the remainder when a is divided by n
• That is a = q x n + r where q is the quotient and r is the remainder
Note: n is called modulus
• Examples:
• 73 mod 7 = 3
• -11 mod 7 = 3
• The clock has a modulus of 12!
Asymmetric Encryption:
RSA Encryption
• Choose two distinct prime numbers p and q. (The integers p
• and q should be chosen at random, similar in size, and large.)
• Compute n = p x q
• The size of n, when expressed in bits, is the key length.
• Computer f = (p-1) (q-1). Find an integer e such that
• 1 ≤ e < f , and
• gcd (e, f ) = 1
• Find d such that
• d x e mod f = 1
• Public key: n, e - This is to be released to everyone
• Private key: d - This must be kept private.
Asymmetric Encryption:
RSA Encryption and Decryption
• Encryption:
• When someone wants to send you a message, they
• Break the message into blocks of length k, where k=log2n
• Convert each message block into a number in a simple agreed upon way such as a =
1, b = 2, c = 3, …
• Compute m = cd(mod n)
• Convert their message back into letters and words
• Assemble the blocks back to a single message
Asymmetric Encryption:
RSA Example
• Generate key pair
• Choose p = 3,q = 11
• Compute n = p x q = 3(11) = 33
• Compute f = (11 – 1) x ( 3 – 1 ) = 20
• Now, select e = 7
• Compute d such that d x 7 mod 20 = 1
• d = 3 ( since 3 × 7 mod 20 = 1 )
• Make n = 33 and e = 7 public.
Asymmetric Encryption:
RSA Example
• Encryption:
• For simplicity, let’s say the message is m. And m = 2.
• Compute c where c = me(mod n).
• 27 = 128, so c = 128 (mod 33) = 29
• because 128 = 29 + 3 x 33
• Your friend will send you the ciphertext c = 29
• Decryption:
• You just received c = 29 from your friend
• Use your private key, d = 3, to compute their message m
• m = cd = 293 = 24389 = 2 (mod 33)
• because 293 = 24389 =2 + 739 x 33
• So your friend sent you the message m = 2
Asymmetric Encryption:
RSA Key Lengths
• In practice, the keys used in asymmetric encryptions are
much longer than our examples.
• For example, in RSA-768, a 768-bit RSA modulus has a 232-
digit decimal representation
• 1230186684530117755130494958384962720772853569595334792197322452151
726400507263657518745202199786469389956474942774063845925192557326
3034537315482685079170261221429134616704292143116022212404792747377
94080665351419597459856902143413.
• Ref: http://eprint.iacr.org/2010/006.pdf
Asymmetric Encryption:
The RSA Challenge (Discontinued)
• It was a challenge put forward by RSA Laboratories on March 18, 1991 to
demonstrate the practical difficulty of factoring large integers and cracking
RSA keys.
• They published a list of the RSA numbers, with a cash prize for the
successful factorization of some of them. The smallest of them, a 100
decimal digit number was factored by April 1, 1991.
• The RSA challenges ended in 2007.
Asymmetric Encryption:
Speed Matters
• Asymmetric encryption is about 1,000 times slower than symmetric
encryption.
• For example, it may take only one second to encrypt a file using
symmetric encryption, such as AES. How much time will it take to
encrypt the same file using asymmetric encryption such as RSA?
☞ So it is typically only
used to privately share a
session key.
Then the session key used in
symmetric encryption to
encrypt data.
Asymmetric Encryption:
Session Key – Symmetric Encryption + Asymmetric
Encryption
Asymmetric Encryption:
Encrypt a session key with asymmetric encryption
• Imagine that Maria's computer is trying to establish a secure session with the
server. The server has a private key matched with a public key shared with
Maria's computer.
• Maria's system creates the session key and then encrypts it with the server's
public key. The encrypted session key is then sent to the server that holds the
matching private key.
• If anyone intercepts the encrypted session key, it is not useful to them because it
can only be decrypted with the matching private key, which is kept private.
Click Personal to
see public keys in
the personal store
Click "Advanced"
to see the details
of the certificate
Asymmetric Encryption:
Securing Email
• Secure/Multipurpose Internet Mail Extensions (S/MIME)
• It is the underlying standard used for most email security.
• It uses public and private keys to encrypt and digitally sign email.
• The sender must have a certificate with a public key embedded that
matches a private key that only the sender can access.
• Within an Active Directory domain, administrators often create a
certification authority (CA) to issue and manage certificates.
• Additionally, public CAs issue and manage certificates that are
commonly used on the Internet and elsewhere.
Asymmetric Encryption:
Securing Email
1) The sender generates a session key for symmetric encryption.
2) The sender encrypts the email using the session key and
symmetric encryption.
3) The sender retrieves the recipient's certificate, which contains the
recipient's public key.
4) The sender encrypts the session key with the recipient's public key.
5) The sender sends both the encrypted email and the encrypted
session key.
6) The recipient receives the encrypted email and the encrypted session
key.
7) The recipient decrypts the session key using the recipient's private key.
8) The recipient uses the decrypted session key to decrypt the contents
of the email.
Asymmetric Encryption:
Securing Email
Encrypting
email
Asymmetric Encryption:
Securing Email
Decrypting
email
Asymmetric Encryption:
Securing Email
• Encrypting email with Microsoft Outlook
Key lifecycle Management
Summary
• Encryption • Strength of AES • Disadvantage of Asymmetric
• Ancient Ciphers • Disadvantage of Symmetric Encryption
• Caesar Cipher Encryption • Slow
• Algorithm + Key • Key Distribution • Session Key
• Symmetric Encryption • Asymmetric Encryption • Encrypted with asymmetric
• DES (obsolete) • Matched Key Pair encryption
• AES (US government + • Private Key • Encrypts the main message
Windows) • Public Key
• Encryption Software • Example: RSA
• OpenPGP •Encryption
•GPG4Win • c = me(mod n)
•Decryption:
• m = cd(mod n)
Reading
• Microsoft Windows Security: Essentials by Darril Gibson, Sybex, 2011 (Available via
Books24x7.com)
• Chapter 2 (Second half)
• Chapter 10
Computer Security
SEHS4515
Lesson Four
Note: Most of the teach materials has been taken from the lectures of Dr. Adam Wong
Topics to be covered in today’s lecture
• Understanding Hashing,
• Applications of Hashing
• Encrypting File System
• Understanding Certificates and
• Public Key Infrastructure
Understanding Hashing
How are your secrets/passwords saved?
User Password
Bob 123abc
ALICE Ilove---myself
Database Server
Hashing
• A hash or hashing is a technique (uses a hashing algorithm) that takes
an input such as a secret/password or a plaintext and it converts it
into a string of text/numbers that always has a same length.
• The resultant is called as a hash or a digest
Understanding Hashing:
Hashing Algorithms
• A hashing algorithm is a mathematical calculation that can be applied
to a file or a message to create a number, called the hash or digest.
• If the public key can't decrypt the encrypted hash, this indicates it wasn't encrypted with the
sender's private key.
• However, if the public key can decrypt the encrypted hash, it proves that the hash was encrypted
with the sender's private key. This authenticates the sender identified in the certificate.
• Also, the sender can't later deny sending the message, because the sender's private key was used
to encrypt the hash. Thus, nonrepudiation is provided.
Understanding Hashing:
Integrity and Non-repudiation
• The digital signature process
occurs with very little user
interaction. E.g. In Microsoft
Outlook, you simply select a
check box to add a digital
signature to a message.
• When the email is received, the
other user opens it, and the
digital signature is verified. If
there are any problems, the user
that received the message is
notified.
Your first participation exercise
• Can you create a message that has the same hash?
Understanding Encrypting
File System (EFS)
Application of Encryption:
Understanding EFS
• Almost all drives used in a Microsoft environment use the New
Technology File System (NTFS). NTFS manages the files on the drives,
helps maintain file integrity, and provides security.
• One of the most important benefits of NTFS is security. The EFS
(Encrypting File System) of NTFS provides confidentiality by
encrypting NTFS files and folders.
• While a file is encrypted with EFS, only specific users can access it.
Understanding EFS
• To encrypt a file/folder, right-click the file/folder, and select
Properties.
• Root CA
• The first CA in a certificate chain is
called the root CA.
• The root CA can issue certificates to
subordinate CAs, and these CAs are
considered to be in the same
certificate chain.
• If a computer trusts the root CA, it
trusts all certificates issued by any
CAs in the certificate chain. Microsoft
systems store certificates from many
public root CAs in the Trusted Root
Certification Authority store.
Understanding a Certificate:
The Certificate Chain
The root CA issues itself a
self-signed certificate. It
can then issue certificates
to intermediate CAs.
Enterprise
CA
https://www.youtube.com/watch?v=SaAwW-6wV_Q&t=15s
Protect Against Attacks
Something the individual knows
• From the slide about dictionary attack, we can see the password would be more
secure if it is random
• However, random password would be difficult to memorize
• So, what to do? Use salt
• Salt is a random data that is used as additional input to a one-way function that
hashes a password
• The salt is stored somewhere for use to be hashed together with the user
password for checking
• Typically, the salt just being tacked right next to the hash, usually with some
delimiter
• Example:
• $1$oaagVya9$NMvf1IyubxEYvrZTRSLgk0
• 3 sections separated by $
• 1 means “algorithm number 1”, i.e. uses MD5
• oaagVya9 is our salt
• NMvf1IyubxEYvrZTRSLgk0 is the actual MD5 sum, base64-encoded
Password File Access Control
Something the individual knows
33
Wireless Authentication Prospects: Secure
Localization
𝑭𝑷𝑹𝑷
𝑨𝑷𝟏
𝟐
𝑭𝑷𝑹𝑷 𝟐 𝑹𝑷 𝟑
𝑨𝑷𝟏 ≅ 𝑭𝑷𝑨𝑷𝟏
#" , 𝑭𝑷𝑹𝑷
𝑨𝑷𝟏
𝟑
𝑑!"!
𝑹𝑷𝟐 𝑹𝑷𝟑
#" %
𝑑!"!
𝑨𝑷𝟏
#" $
𝑑!"!
Proximity Proximity
ROOM 1 ROOM 2
𝑹𝑷𝟏
LOS 𝑭𝑷𝑹𝑷
𝑨𝑷𝟏
𝟏
NLOS