0% found this document useful (0 votes)
6 views120 pages

Module1 Avs (1)

The document provides an overview of data security and privacy, defining key concepts such as security, privacy, data security, and information security. It discusses cybersecurity principles, including the CIA triad (confidentiality, integrity, availability), and various encryption techniques like symmetric and asymmetric encryption. Additionally, it covers classical encryption methods, including the Caesar cipher and Playfair cipher, highlighting their strengths and weaknesses.

Uploaded by

Jayashree M
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views120 pages

Module1 Avs (1)

The document provides an overview of data security and privacy, defining key concepts such as security, privacy, data security, and information security. It discusses cybersecurity principles, including the CIA triad (confidentiality, integrity, availability), and various encryption techniques like symmetric and asymmetric encryption. Additionally, it covers classical encryption methods, including the Caesar cipher and Playfair cipher, highlighting their strengths and weaknesses.

Uploaded by

Jayashree M
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DATA SECURITY AND

PRIVACY
BAD703
Data Security & Privacy - Intro
➢Security ?
➢Privacy?
➢Why security is needed?
➢Security Privacy in day to day life – whatsapp end to end encryption, OTP, Password…
➢Data security Vs Information security
➢What is this subject all about?
➢Is this concept of Security, privacy new or old?
➢Any time used Non verbal communication ? Coded language?
Data Security & Privacy - Intro
•Security is about locking the diary so no one can read or change it.
•Privacy is about deciding who is allowed to read it in the first place.

Data Security means protecting data from unauthorized access, use, or change.

Data Security: Secures data in digital form


Information Security: Secures all forms of information (digital, physical, verbal)
Data Security & Privacy - Intro
Security techniques used by Kings
➢Staganograpgy
▪ slave tattoo

➢Ciphers and codes


➢Trusted messengers
➢Physical device: scytale
➢Whistling language – Sri Lanka
➢Invisible ink – when heated message visible
➢Microdots – tiny photos with hidden messages
Module 1
CIA triad
What is Cybersecurity?
Cybersecurity means protecting information — like files, messages, and passwords — that are stored, sent, or
used on computers, mobile phones, or over the internet. It's like locking your house, mailbox, and phone to keep
your secrets safe from thieves.
Cybersecurity makes sure:
◦ Only the right people can see the information (confidentiality).
◦ Nothing is changed or tampered with (integrity).
◦ The information is always available when needed (availability).
◦ You know who sent or changed something (authenticity).
◦ No one can deny what they did (accountability).
To do all this, we use:
◦ Rules and company policies (like telling employees not to share passwords).
◦ Technology, like:
◦ Encryption (turning data into secret codes),
◦ Secure communication tools (safe apps/websites).
What are the parts of Cybersecurity?
Information Security
◦ This protects all types of information, including:
◦ Digital (like files or emails)
◦ Physical (like printed papers)
◦ It ensures:
◦ Privacy
◦ Accuracy of data
◦ Availability
◦ Trust, and responsibility for actions.

Network Security
◦ This protects networks (like Wi-Fi or the internet).
◦ It stops hackers from:
◦ Breaking in
◦ Changing or destroying data
◦ Spying on communication
◦ Also ensures the network runs smoothly.
Differences
◦ Cybersecurity = Big umbrella that covers everything related to protecting digital data and networks.
◦ Information Security = Focuses on keeping any type of information safe (digital or on paper).
◦ Network Security = Focuses on keeping network systems safe.

In real life, people often use cybersecurity and information security to mean the same thing —
but technically, cybersecurity is a broader term.
1.8 A model for network security
What is Network Security ?
❑keeping your messages and information safe online.

Why do we need security?


◦ Because there are people (called attackers or hackers) who might:
◦ Read your message without permission.
◦ Change your message before it reaches your friend.
◦ Pretend to be you and send fake messages. -impersonation
How do we protect messages? What is a trusted third party?
Two main tools: ❑Sometimes, a trusted helper (like a postman) is needed to:
❑Scrambling the message ❑ Safely give both the secret key.
(Encryption) ❑ Settle disputes if one person says, “I didn’t send that message!”
This means turning your
message into a secret code that
only your friend can understand. To build a secure communication, we need to:
❑Sharing a secret key ❑Create a way to scramble the message (a secure method).
This is like a special password ❑Make the secret key.
that only you and your friend
know. It helps you lock and ❑Find a safe way to share the key.
unlock the scrambled message. ❑Set rules for how both people will send and receive
messages securely.
But there’s more... What else can go wrong?
Apart from protecting messages,
we also need to protect entire Some programs (like viruses and worms) can sneak
computer systems from: into your computer and:
❑Hackers, who break in for fun or ❑Steal or change information.
for harm. ❑Make your system slow or crash.
❑Angry employees who want to
cause damage. These threats might come from infected USBs or
from downloading something online.
❑Criminals who steal things like
credit card info.
How do we defend against all this?
We use two layers of protection:
1. Gatekeepers (First Line of Defense)
✓Passwords to block unwanted users.
✓Antivirus tools to catch harmful software.

2. Guards Inside the System (Second Line of Defense)


✓Monitor what’s happening.
✓Spot any suspicious behavior.

Open source/Paid Tools : Snort, OSSEC, or Splunk (act like security cameras inside the system)-
watching and reporting suspicious activity
Review Questions
1) What are the 2 main tools to protect messages?
2) Who is trusted third party?
3) Which are the 2 layers of protection?
Chapter 3 : Classical Encryption Techniques
Intro
Symmetric Encryption – One Key for Lock and Unlock Asymmetric Encryption – Two Keys: Public & Private
❑Conventional encryption/single-key ecryption ❑Think of it like a mailbox:
❑Anyone can drop a letter inside using the public key
❑lock the message with a key and share the same key (locking it).
with the receiver to unlock it. ❑But only you have the private key to open the mailbox and
read it.
❑Fast and simple.
❑But both sender and receiver must safely share the ❑Uses two keys — one for locking, another for
key — if someone steals it, they can read the message. unlocking.

❑Usage-File encryption, Wi-Fi security ❑Safer, especially for things like online payments.

Example: AES, DES, RC4 ❑But it's slower and more complex.
❑Usage - Digital signatures, SSL/TLS (web security)
Example: RSA, ECC
Key Terminologies

•Plaintext: The original, readable message or data (e.g., "Hello, friend!").


•Ciphertext: The scrambled or coded version of the plaintext after encryption (e.g., "Xf78@#lZ").

•Encryption / Enciphering: The process of converting plaintext into ciphertext to keep it secret.

•Decryption / Deciphering: The process of turning ciphertext back into plaintext so it becomes
readable again.

•Cryptography: Area of study constituting many schemes used for encryption

•Cipher / Cryptographic System: A specific method or technique used to encrypt information.

•Cryptanalysis: The art of decoding or breaking the code without knowing how it was encrypted (used
by hackers or analysts).

•Cryptology: The combined field of cryptography (Encryption) and cryptanalysis (breaking them).
3.1 Symmetric Cipher Model
Plain text : Original understandable message/data that is fed into algorithm as input
Encryption Algorithm : Performs various substitution and transformations on the plain text
Secret Key :
◦ i) Also input to Encryption Algorithm
◦ Ii) is independent of plain text
◦ Iii) Output depends on Key. For same input, same algorithm gives different output based on key
◦ Iv) Depending on the key, different substitution & transformations are performed.
Cipher text : Coded message / scrambled message produced as output, unintelligible, depends
on plain text & key, for the same message -> 2 different keys give 2 different cipher texts
Decryption Algorithm: Encryption algorithm run in reverse, Takes cipher text & key as input and
produces back the plain text as output
Two requirements for the secure use of encryption :
1. The encryption method(algorithm) must be strong, so that even if a hacker knows how it
works, they still can’t figure out the message or the secret key.
❑Even if a hacker sees many examples of the secret message (plaintext) and its coded version
(ciphertext), they still should not be able to break the code.

2. The secret key must be shared securely between the sender and receiver — if someone else
finds the key, they can read all the messages.
❑If the key is not kept secret, the encryption is useless, no matter how strong the method is.

Manufacturers have created cheap encryption chips that are now used in many devices.
Plaintext X = [X1, X2, …. XM].
◦ The M elements of X are letters in some finite alphabet. (26 capital letters)

For encryption, a key of the form K = [K1, K2, .... KJ]


◦ Key generation : by message source/ third party

Sender side: ciphertext Y = E(K, X)


Receiver Side : plain text X = D(K, Y)
Cryptography
Cryptography is how we turn a message into a secret code to keep it safe.
Cryptographic systems (ways of doing encryption) are described using 3 main points:
1. How the message is changed (Operations/algorithm used):
There are two basic ways:
Substitution: Replace letters or bits with other ones (like A becomes Z).
Transposition: Rearranging the order of letters or bits (like “HELLO” becomes “OLLEH”).
The changes must be reversible, so the original message can be brought back.
2. How many keys are used
Symmetric (Single-key): One secret key is shared by both the sender and the receiver
Asymmetric (Two-key / Public-key):Two keys are used – one to lock (encrypt) and one to unlock (decrypt).
Ex: Like a mailbox where anyone can drop a letter, but only the owner has the key to open it.
3. How the message is processed
Block Cipher: Breaks the message into chunks or blocks, then encrypts each block
Stream Cipher: Encrypts the message one bit or letter at a time, continuously
Review Questions
1) What is symmetric encryption?
2) What is asymmetric encryption?
3) What is plain text?
4) What is cipher text?
5) What is encryption?
6) What is decryption?
7) What is enciphering?
8) What is deciphering?
9) What is cryptography?
10) What is cryptanalysis?
11) What is cryptology?
3.2 Substitution Techniques
Objective of study: basic approaches to symmetric encryption used today and the types of
cryptanalytic attacks that must be anticipated.
Two basic building blocks of all encryption techniques are substitution and transposition.
A substitution technique is one in which the letters of plaintext are replaced by other letters or
by numbers or symbols. After transformation, plain text & cipher text have different characters
set.
◦ If the plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit
patterns with ciphertext bit patterns.
3.2 Substitution Techniques - Caesar Cipher
The earliest known, and the simplest, use of a substitution cipher was by Julius Caesar.
The Caesar cipher : replacing each letter of the alphabet with the letter standing three places
further down the alphabet. Alphabet is wrapped around, so that the letter following Z is A.

Note : In cryptography, convention is


Plain text is written in lower case letters and Cipher text is written in Upper case letters.
If brute-force cryptanalysis is applied, we can easily get the plain text:
1. The encryption and decryption algorithms are known. (Knowing how Caesar cipher works)
2. There are only 25 keys to try. (Key space is small)
3. The language of the plaintext is known and easily recognizable . (if English is the language)

Caesar cipher is less secure


25 attempts
(possibilities) are
enough to break
the encoded
message
Activity 1
Try encoding and decoding your name with key 5 using Caesar cipher.
Observation: Different keys for the same algorithm gives different cipher texts
Review Questions
1) What is Caesar cipher?
2) What is the formula for Encryption using Caesar cipher?
3) What is the formula for Decryption using Caesar cipher?
4) How many attempts to be made in the brute force cryptanalysis of Caesar cipher?
5) What is substitution technique?
6) What is transposition technique?
Monoalphabetic cipher
“Cipher” line can be any permutation of the 26 In general, there are n! permutations of a
alphabetic characters set of n elements, because the first
element can be chosen in one of n ways,
A permutation is a finite set of elements ‘S’ is an the second in n - 1 ways, the third in n – 2
ordered sequence of all the elements of ‘S’ with each ways, and so on.
element appearing exactly once.

Permutation –> Factorial


Monoalphabetic cipher
A character in the plain text is always replaced by a character in the cipher text regardless of its
position
Relationship between a character in the plain text to a character in the cipher text is always one-
to-one
Cipher text - DULA
Review Questions
1) What is monoalphabetic cipher?
2) Is the above technique secure?
3) What is the drawback of the technique?
4) How many attempts are to be made in the brute force cryptanalysis of monoalphabetic
cipher?
Hill Cipher
Review Questions
1) What is the encryption formula used in Hill cipher?
2) What is the decryption formula used in Hill cipher?
3) Write the formula used to calculate determinant of a matrix?
4) Write the formula used to calculate adjoint of a matrix?
Playfair Cipher
The Playfair algorithm is based on the use of a 5 x 5 matrix of letters constructed using a
keyword.
The Playfair cipher was the first practical digraph substitution cipher. The scheme was invented
in 1854 by Charles Wheatstone but was named after Lord Playfair who promoted the use of the
cipher. In playfair cipher unlike traditional cipher we encrypt a pair of alphabets(digraphs)
instead of a single alphabet.
It was used for tactical purposes by British forces in the Second Boer War and in World War I and
for the same purpose by the Australians during World War II. This was because Playfair is
reasonably fast to use and requires no special equipment.
Advantages:
The Playfair cipher is harder to break than simple substitution ciphers.
In normal substitution, each letter is replaced (26 possibilities), but here, pairs of letters (called
digram) are replaced, giving 25 × 25 = 625 possibilities.
This makes frequency analysis (counting how often letters appear) much more difficult, and it
needs a lot more secret text to guess the key.
Disadvantages:
If a pair of letters in the secret text (like AB) and its reverse (BA) appear, they will be linked to
reversed pairs in the normal text (like UR and RU). This “self-inverse” property can be used by
someone to crack the code, especially if they know the language.
It is a symmetric cipher, meaning the same key is used for both locking (encryption) and
unlocking (decryption), so if someone gets the key, they can read everything.
Review Questions
1) What is Playfair cipher?
2) Is Playfair cipher a substitution technique or transposition technique?
Polyalphabetic substitution cipher
This is an improvement over simple monoalphabetic technique, where each occurrence of a
plaintext letter substituted by the same letter in all the places-> vulnerable to attacks.
Here Each occurrence of a character in plain text may have different substitute in the cipher text
and is dependent on its position in the plain text
Relationship between a character in the plain text to a character in the cipher text is always one-
to-Many
Common features:
1. A set of related monoalphabetic substitution rules is used
2. A key determines which particular rule is chosen for a given transformation.
Polyalphabetic cipher

Old mapping

Completely new mapping


Polyalphabetic cipher – Vigenere cipher
It consist of 26 Caesar ciphers with shifts of 0 through 25.
Caesar cipher with a shift of 3 is denoted by the key value 3

Length of plain text and key must


match to have the same length
cipher text.

Key will be repeating – to match the


length
Vigenere cipher – Cryptanalysis:
• Determining the length of the keyword
• Key and the plain text share the same frequency distribution of letters(English alphabets), a statistical technique can
be applied.
Vigenere cipher
Same plaintext letter can become different ciphertext letters, so frequency is hidden.
But repeated sequences in ciphertext help attackers guess the keyword length (Kasiski test).
Once keyword length is known, cipher reduces to solving many Caesar ciphers.

Advantage: Stronger than Caesar/monoalphabetic, hides simple frequency.


Disadvantage: Can be cracked with long text using frequency analysis + keyword length attacks.
Vernam Cipher
Vernam cipher Cryptanalysis:
•Uses a tape with a long key sequence that keeps repeating (like a very long Vigenère key).
•Because the key repeats, patterns eventually appear.
•With enough ciphertext (and maybe some guessed plaintext), the cipher can be broken.

Advantage
•Stronger than short-key Vigenère (because key is longer).
•Harder to crack if key length is very large.
Disadvantage
•Since the key repeats, it is not perfectly secure.
•With enough ciphertext + known/plaintext attack, it can be broken.
Review Questions
1) What is polyalphabetic cipher?
2) Is polyalphabetic cipher a substitution technique or transposition technique?
3) What are the variations in polyalphabetic cipher?
One time pad (OTP)
•Improvement over Vigenère/Vernam cipher.
•Uses a truly random key that is as long as the message.
•Each key is used only once and then discarded.
•This makes it unbreakable → ciphertext has no patterns, looks
completely random.
•Even if attacker tries all keys, they will get many possible plaintexts
and can’t know which is correct.

The One-Time Pad is the only cipher that guarantees perfect secrecy, but it is impractical because of key
generation and distribution problems.
Advantages
❑Perfect secrecy (theoretical 100% secure).
❑Ciphertext reveals zero information about plaintext.
Disadvantages
❑Need huge supply of truly random keys.
❑Key distribution problem → sender and receiver both must securely share very long keys.
❑Impractical for regular or high-volume communication.
Key Generation in One-Time Pad
[Link] key must be as long as the message (e.g., for 100 letters of text, the key must also be 100
random letters/numbers).
[Link] key must be truly random – not repeating, not predictable.
•Example sources: hardware random number generators.
•Not from a computer program using formulas (those are pseudo-random).
[Link] key is used only once for one message. After encryption/decryption, it is discarded
forever.

Example
Plaintext: HELLO (5 letters)
Random Key: XMCKL (5 random letters)
Ciphertext = Plaintext ⊕ Key (XOR operation if using binary, or modular addition if using letters).
Result → looks completely random, no patterns.
Steganography
Steganography hides the existence of a message (unlike encryption, which hides the meaning). It is great for
secrecy, but once detected, it fails.
Historical Examples
▪ Hidden letters: first letters of each word/line form the secret message.
▪ Character marking: tiny pencil marks on letters.
▪ Invisible ink: message revealed only with heat/chemicals.
▪ Pin punctures: small holes on letters, visible only in light.
▪ Typewriter ribbon trick: letters typed faintly, visible only under strong light.

Modern Examples
➢Hide data inside images, audio, or video files.
➢ Example: Least Significant Bit (LSB) method → changing the smallest pixel values in an image to store secret data.
➢ You can hide about 130 KB message inside one photo without noticeable quality change.

➢Special software tools are available to do this.


Advantages
Does not draw attention → message looks like harmless data (image, text, audio).
Useful when even the fact of secret communication must be hidden.
Disadvantages
Hides only small amounts of data (overhead is large).
If the hiding method is discovered, the scheme becomes useless.
Often combined with encryption + steganography for better security.
Oxford Summer Fees the Admin just really these and this
The same image viewed by white, blue, green, and red lights reveals different hidden
numbers.

[Link]
Block Ciphers and Data
Encryption Standards
4.1 Traditional Block Cipher structures
Stream Ciphers and Block Ciphers:
Stream Ciphers Block Ciphers
Encrypts a digital data stream one bit or one Block of plaintext is treated as a whole and
byte at a time. used to produce a ciphertext block of equal length.
Ex: Autokeyed Vigenère cipher and Block size of 64 or 128 bits
the Vernam cipher.
Applicable to a broader range of applications than
stream ciphers
Ex: network-based symmetric cryptographic
applications , Client-server communication
Faster, low latency Faster, low latency
Key stream generated continuously Key stream generated continuously
Real-time data (voice, video) File encryption, secure communications
Good for real-time continuous data. Good for real-time continuous data.
Affects only one bit/byte Affects only one bit/byte
Example: RC4. Example: AES, DES.
Block vs Stream Ciphers
➢ block ciphers process messages in blocks, each
of which is then en/decrypted
➢ like a substitution on very big characters
⚫ 64-bits or more
➢ stream ciphers process messages a bit or byte
at a time when en/decrypting
➢ many current ciphers are block ciphers
⚫ better analyzed
⚫ broader range of applications
Block vs Stream Ciphers
➢ Q: What is a block cipher we have already
seen?
➢ A: Playfair cipher. What is its block size?
➢ A: 2 characters
➢ Q: What are some stream ciphers we have
already seen?
➢ A: Autokey cipher, Vigenere cipher, Vernam
cipher, OneTime Pad (OTP)
Confusion & Diffusion
Diffusion
Idea: Spread the influence of each plaintext character across many ciphertext characters.
Why: So that patterns in the plaintext (like letter frequency, common words) don’t show up in
the ciphertext.
How: Mix the data so that one character of plaintext affects many parts of ciphertext.
Analogy : Bucket water + ink

Diffusion = hide plaintext patterns by spreading them out.


Confusion
Idea: Make the relationship between the ciphertext and the encryption key as complicated as
possible.
Why: So that even if an attacker sees ciphertext patterns, it’s very hard to figure out the key.
How: Use complex substitution rules (not simple letter swaps).

Confusion = hide key patterns by making encryption rules complex.


Together, diffusion + confusion = strong encryption (used in modern block ciphers like AES).
Fiestel Cipher:
Design model for building ciphers (used in DES)
Idea: Split data into 2 halves mix one half with key, swap & repeat
2 fundamental operations within Round function which work together to create confusion and
diffusion in encrypted data
1) Substitution
Replacing input blocks of data with different blocks based on predefined rules achieved using S-
boxes (Substitution boxes)-which map input blocks of data to output blocks
2) Permutation
Rearranges the order of data bits
Fiestel cipher uses these 2 operations alternatively within its rounds
Fiestel Cipher Structure:
General framework
Split -> Round function -> Swap -> Repeat
FEISTEL CIPHER STRUCTURE
Substitution in Fiestel cipher
Within round function (F), the right half of data is processed with a subkey to produce
substituted output, which is XORed with left half.
-> creates a complex relationship between input and key contributing to confusion where
relationship between key and ciphertext is masked.
Permutation in Fiestel Cipher
Permutation (Transposition)
-> rearranges the order of data elements rather than replacing them.
In Fiestel cipher, permutation step is typically act of swapping the two halves of the data at the
end of each round.
This mixing of bits spreads the influence of any single input bit across multiple output bits, called
diffusion.
How they work together?
Combination of substitution & permutation is crucial for security in Fiestel cipher
Substitution –creates complex non-linear relationships between input data and key
Permutation- spreads these complex relationships across entire block of data
Iterative application of substitution & permutation across multiple rounds along with use of
different subkeys, makes cipher resistant to analysis and ensures strong avalanche effect, where
a small change in plaintext or key leads to significant change in ciphertext.
Different affecting parameters & design
features
1) Blocksize
Larger blocksize => greater security
Decreased encryption/decryption speed
Blocksize 64 bits- DES
Blocksize 128 bits- AES
2) Key size
Larger key size-> greater security
Decreased encryption/decryption speed
Key size of 64 bits or less is not enough now
128 bits is common key size
Different affecting parameters & design
features
3) [Link] rounds
Single round => no security
Multiple rounds increases security
Typically 16 rounds
4) Subkey generation algorithm
Greater complexity in this algorithm=> greater difficulty of cryptanalysis
5) Round function (F)
Greater complexity in this algorithm=> greater difficulty of cryptanalysis
Different affecting parameters & design
features
6) Fast software encryption/decryption
Implementing encryption & decryption using software (not hardware)
But speed of execution of these algorithm is concern
7) Ease of analysis
Easy algorithm => easy to analyse to check for vulnerabilities
=> to develop more sophisticated manner
DES is not easy to analyse
Motivation for the Fiestel Cipher Structure
Data Encryption Standard (DES)
DES encryption has 2 inputs to encryption function
i) plaintext to be encrypted
Ii) key
Here plain text – 64 bit block
Key – 56 bits length
Figure has 2 sides
LHS of figure – has 3 phases of processing of plain text in 3 phases
RHS of figure
DES decryption
A DES Example
•DES Input/Output
•Plaintext = 64-bit block.
•Key = 56 bits (after removing parity).
•Ciphertext = 64-bit block.
•Example: Input given as hex string, output shown as another hex string.
•Initial Permutation (IP)
•Rearranges input bits.
•Example shows how a hex plaintext → permuted 64-bit block.
•Analogy: Like shuffling cards before starting a game.
•One Round Illustration
•Input split into L0 and R0 (32 bits each).
•Show how round key is applied in Round 1.
•Don’t expand math → just tell “this mixes left and right halves.”
•Final Permutation (FP)
•After 16 rounds, swap L and R, apply FP → Ciphertext.
•Example shows final ciphertext.
•Important Takeaway
•Even if plaintext and key look simple, output looks random.
•Small change in plaintext or key → completely different ciphertext (avalanche effect).
The strength of DES
1) Use of 56-bit keys
2) nature of DES Algorithm
3) Timing attacks
Block cipher design principles
(Guidelines to build strong ciphers)
1) Number of rounds
2) Design of function F
3) Key Schedule Algorithm
Note : Also Refer the notes given during
few of the topic discussions & Text book
for more description.

You might also like