Saturday, June 13, 2026

Unit 1: Introduction to Machine Learning

 Subject: Machine Learning Techniques (MCA556)


From your Semester III syllabus. 




---


What is Machine Learning?


Machine Learning (ML) is a branch of Artificial Intelligence (AI) that enables computers to learn from data and make decisions without being explicitly programmed.


Example


Netflix recommends movies.


YouTube recommends videos.


Gmail detects spam emails.




---


Basic Definitions


Data


Raw facts and figures.


Example:


Age = 20

Marks = 85


Dataset


Collection of data.


Example:


Age Marks


18 70

19 75

20 85




---


Learning


Learning means improving performance using experience (data).


Formula:


Experience + Data → Learning → Better Predictions



---


Types of Machine Learning


The syllabus covers several learning types. 


1. Supervised Learning


Data contains inputs and correct outputs (labels).


Examples:


Predicting house prices


Predicting exam results



Algorithms:


Linear Regression


Decision Trees


SVM




---


2. Unsupervised Learning


Data has no labels.


Purpose:


Find hidden patterns


Group similar data



Examples:


Customer segmentation


Clustering



Algorithms:


K-Means


Hierarchical Clustering




---


3. Reinforcement Learning


Learning through rewards and penalties.


Example:


Self-driving cars


Game-playing AI




---


Hypothesis Space


A hypothesis is a possible solution/model.


Example: For predicting marks:


Marks = 5 × Study Hours + 30


All possible models together form the Hypothesis Space.



---


Inductive Bias


Assumptions made by a learning algorithm to generalize unseen data.


Example: Linear Regression assumes a linear relationship.



---


Evaluation of a Model


After training, we evaluate performance.


Questions:


Is the model accurate?


Can it predict correctly on new data?




---


Cross Validation


Used to test model reliability.


Most common:


K-Fold Cross Validation


Steps:


1. Split data into K parts.



2. Train on K−1 parts.



3. Test on remaining part.



4. Repeat K times.



5. Calculate average accuracy.




Benefits:


Better evaluation


Reduces overfitting




---


Linear Regression


One of the simplest ML algorithms.


Used for:


Predicting continuous values



Example:


House price prediction


Salary prediction



The model is represented by:


genui{"math_block_widget_always_prefetch_v2":{"content":"y=mx+b"}}Where:


y = predicted value


m = slope


b = intercept




---


Decision Trees


A tree-like model used for classification and prediction.


Example:


Study?

   |

  Yes

   |

Pass


No

 |

Fail


Advantages:


Easy to understand


Easy to visualize




---


Overfitting


Occurs when a model memorizes training data instead of learning patterns.


Symptoms


High training accuracy


Poor test accuracy



Example: Student memorizes answers but cannot solve new questions.



---


Learning System Design


Steps:


1. Collect Data



2. Preprocess Data



3. Select Features



4. Train Model



5. Evaluate Model



6. Deploy Model





---


Perspectives and Issues in ML


Common challenges:


Data Quality


Bad data → Bad predictions


Overfitting


Model learns noise


Underfitting


Model is too simple


Computational Cost


Large datasets need more resources



---


Ensemble Learning


Combines multiple models to improve performance.


Idea:


Many Weak Models

       ↓

Combined

       ↓

Strong Model


Examples:


Random Forest


Boosting




---


Applications of Machine Learning


Healthcare


Disease prediction


Banking


Fraud detection


Education


Student performance prediction


E-commerce


Product recommendations


Agriculture


Crop prediction



---


Feature Engineering


Process of selecting and transforming useful features.


Example:


Original Data:


Date: 13-06-2026


Feature Engineering:


Day = Saturday

Month = June

Year = 2026


Benefits:


Improves accuracy


Reduces complexity




---


Important Exam Questions


Short Questions


1. Define Machine Learning.



2. What is Supervised Learning?



3. What is Unsupervised Learning?



4. Define Reinforcement Learning.



5. What is Cross Validation?



6. What is Overfitting?



7. What is Feature Engineering?



8. Define Hypothesis Space.





---


Long Questions


1. Explain different types of Machine Learning.



2. Discuss Cross Validation with examples.



3. Explain Linear Regression.



4. Explain Decision Trees.



5. What is Overfitting? How can it be reduced?



6. Explain the design of a learning system.





---


Quick Revision


ML = Learning from data.


Supervised = Labeled data.


Unsupervised = Unlabeled data.


Reinforcement = Reward/Penalty.


Linear Regression = Prediction algorithm.


Decision Tree = Tree-based model.


Overfitting = Memorizing training data.


Cross Validation = Reliable testing.


Feature Engineering = Creating useful features.



Next: Unit 2


Evaluation Metrics (Precision, Recall, F1, MSE), K-Means Clustering, Bayes Learning, Gaussian Mixture Models, Feature Reduction. This unit is very important for both exams and ML interviews.

Unit 5 — Malware, OS Hardening, Firewall, Digital Signature Standard

 

From MCA553 (Principles of Cryptography and Cyber Security). 



---


Malware


Malware = Malicious Software


Software designed to damage, steal, spy on, or disrupt computer systems.


Objectives:


Steal information


Destroy data


Spy on users


Gain unauthorized access




---


Types of Malware


1. Virus


A virus attaches itself to a file or program and spreads when that file runs.


Characteristics:


Requires user action


Can corrupt files


Slows system performance



Example: Infected USB drive.



---


2. Worm


A worm spreads automatically through networks.


Characteristics:


No user action required


Self-replicating


Consumes bandwidth



Example: WannaCry Worm.



---


Difference Between Virus and Worm


Virus Worm


Needs host file Independent

User action needed Automatic spread

Slower spread Faster spread




---


3. Trojan Horse


Malware disguised as legitimate software.


Example: Fake antivirus software.


Characteristics:


Looks genuine


Creates backdoor access


Steals information




---


4. Rootkit


Designed to hide malware activities.


Functions:


Hides files


Hides processes


Hides network connections



Danger: Very difficult to detect.



---


5. Bot (Robot)


An infected computer controlled remotely by attackers.


A collection of bots forms a:


Botnet


Used for:


Spam attacks


DDoS attacks


Cryptocurrency mining




---


6. Adware


Displays unwanted advertisements.


Effects:


Pop-up ads


Browser redirection


Slow performance




---


7. Spyware


Secretly collects information.


Steals:


Passwords


Banking details


Browsing history




---


8. Ransomware


Encrypts files and demands money.


Process:


Files Locked

      ↓

Payment Demanded

      ↓

Decryption Key Promised


Example: WannaCry Ransomware.



---


9. Zombie


A compromised computer controlled remotely.


Used in:


DDoS attacks


Botnets



User usually does not know their system is infected.



---


Malware Analysis


Process of studying malware.


Purpose:


Understand behavior


Identify threats


Develop defenses



Types:


Static Analysis


Without running malware.


Examines:


Code


Strings


File structure




---


Dynamic Analysis


Running malware in a controlled environment.


Observes:


Network activity


File modifications


Registry changes




---


OS Hardening


OS Hardening means securing an operating system by reducing vulnerabilities.


Purpose:


Increase security


Reduce attack surface




---


Process Management


Monitor running processes.


Actions:


Stop suspicious programs


Limit privileges




---


Memory Management


Protect memory from unauthorized access.


Methods:


Access control


Memory protection




---


Task Management


Control applications and services.


Benefits:


Remove unnecessary programs


Improve security




---


Windows Registry Security


Registry stores system settings.


Hardening Steps:


Restrict access


Backup registry


Remove malicious entries




---


Services Configuration


Disable unnecessary services.


Examples:


Unused FTP services


Unused Remote Access services



Benefits:


Reduced attack surface




---


Antivirus Protection


Antivirus software detects and removes malware.


Functions:


Scan files


Real-time protection


Quarantine threats



Examples:


Microsoft Defender


Quick Heal


Avast




---


Anti-Spyware Tools


Designed specifically to detect spyware.


Functions:


Remove tracking software


Protect privacy




---


System Tuning Tools


Improve performance and security.


Functions:


Remove junk files


Optimize startup


Clean registry




---


Anti-Phishing Tools


Protect users from fake websites and emails.


Features:


URL checking


Email scanning


Browser protection




---


Firewall


A firewall monitors and controls network traffic.


Acts as a security gate between:


Internet

   ↓

Firewall

   ↓

Private Network



---


Firewall Design Principles


1. All traffic must pass through firewall


No direct access.



---


2. Only authorized traffic allowed


Rules determine access.



---


3. Firewall itself must be secure


Cannot be easily attacked.



---


Types of Firewalls


Packet Filtering Firewall


Checks packets individually.



---


Stateful Inspection Firewall


Tracks active connections.



---


Application Firewall


Protects applications.


Example: Web Application Firewall (WAF)



---


Trusted Systems


Systems designed with built-in security mechanisms.


Features:


Access control


Auditing


Authentication




---


Digital Signature


Digital signature proves:


1. Sender identity



2. Data integrity



3. Non-repudiation




Uses:


Private Key


Public Key




---


Authentication Protocol


Rules used to verify identity.


Examples:


Password Authentication


OTP Authentication


Kerberos


Multi-Factor Authentication (MFA)




---


Digital Signature Standard (DSS)


A standard developed by the U.S. government for digital signatures.


Purpose:


Secure electronic communication


Verify authenticity



Benefits:


Authentication


Integrity


Non-repudiation




---


Important Exam Questions


Short Questions


1. What is Malware?



2. Define Virus.



3. Define Worm.



4. What is Trojan Horse?



5. What is Ransomware?



6. What is OS Hardening?



7. What is a Firewall?



8. What is DSS?





---


Long Questions


1. Explain various types of malware.



2. Differentiate Virus and Worm.



3. Explain OS Hardening techniques.



4. Discuss Firewall design principles.



5. Explain Digital Signature Standard.



6. Explain Malware Analysis techniques.





---


One-Day Exam Revision (MCA553)


Remember:


CIA = Confidentiality, Integrity, Availability


Cyber Forensics = Investigation of digital crimes


RSA = Public Key Cryptography


Diffie-Hellman = Key Exchange


AES = Modern Encryption Standard


Triple DES = DES × 3


Hash Function = Fixed-size fingerprint


MAC = Message Authentication Code


Virus = Needs host file


Worm = Self-spreading


Trojan = Fake software


Ransomware = Encrypts files for money


Firewall = Controls network traffic


DSS = Digital Signature Standard



You have now completed Cyber Security (MCA553) from your Semester III syllabus. Next, I recommend Machine Learning Techniques (MCA556) because it is one of the easiest and most scoring papers in Semester III. 

Unit 4 — Advanced Encryption Standard (AES), Triple DES, RC4, Hash Functions & MAC

 


From MCA553 (Principles of Cryptography and Cyber Security).


Advanced Encryption Standard (AES)

AES is the modern replacement for DES.

Developed by:

  • NIST (National Institute of Standards and Technology)

Features:

  • Symmetric Key Algorithm
  • Faster than DES
  • More Secure

AES Key Sizes

  • 128-bit
  • 192-bit
  • 256-bit

AES Block Size

  • 128 bits

Why AES Replaced DES?

DES AES
56-bit key 128/192/256-bit key
Less secure Highly secure
Slower Faster
Vulnerable to brute force Resistant to brute force

AES Working

AES performs multiple rounds:

  • SubBytes
  • ShiftRows
  • MixColumns
  • AddRoundKey

Rounds:

  • AES-128 → 10 rounds
  • AES-192 → 12 rounds
  • AES-256 → 14 rounds

Evaluation Criteria for AES

While selecting AES, the following were considered:

  1. Security
  2. Performance
  3. Flexibility
  4. Simplicity
  5. Implementation efficiency

Multiple Encryption

Applying encryption more than once.

Purpose:

  • Increase security
  • Reduce vulnerability

Example:

Plain Text
   ↓
DES
   ↓
Cipher Text
   ↓
DES Again
   ↓
More Secure Cipher Text

Triple DES (3DES)

Uses DES three times.

Process:

Encrypt
 ↓
Decrypt
 ↓
Encrypt

(EDE Method)

Key Length

  • 168 bits

Advantages

  • More secure than DES

Disadvantages

  • Slower than AES

Block Cipher Modes of Operation

When data is larger than one block, special modes are used.

ECB (Electronic Code Book)

Each block encrypted separately.

Advantages:

  • Simple

Disadvantages:

  • Pattern leakage
  • Less secure

CBC (Cipher Block Chaining)

Each block depends on previous block.

Advantages:

  • Better security

Disadvantages:

  • Error propagation

CFB (Cipher Feedback)

Converts block cipher into stream cipher.

Used in:

  • Real-time communication

OFB (Output Feedback)

Generates key stream independently.

Advantages:

  • Errors do not propagate

Stream Cipher

Encrypts data one bit or byte at a time.

Advantages:

  • Fast
  • Suitable for communication systems

Examples:

  • RC4

RC4

A famous stream cipher.

Features:

  • Variable key length
  • Fast execution
  • Simple implementation

Applications:

  • SSL/TLS (older versions)
  • Wireless security

Disadvantage:

  • Several security weaknesses discovered
  • Not recommended today

Message Authentication

Ensures:

  1. Sender is genuine
  2. Message is not modified

Authentication Requirements

A secure system should provide:

  • Integrity
  • Authentication
  • Non-repudiation

Authentication Functions

Used to verify authenticity.

Methods:

  • Hash Functions
  • Digital Signatures
  • MAC

Hash Function

Converts data of any size into fixed-size output.

Properties:

  • One-way function
  • Fast computation
  • Difficult to reverse

Example:

HELLO
↓
Hash Function
↓
8b1a9953...

Characteristics of Good Hash Function

  1. Fixed length output
  2. Fast computation
  3. Collision resistant
  4. One-way operation

Popular Hash Algorithms

  • MD5
  • SHA-1
  • SHA-256
  • SHA-512

Message Authentication Code (MAC)

Used to verify:

  • Message Integrity
  • Sender Authenticity

Structure:

Message + Secret Key
         ↓
       MAC

Receiver recalculates MAC and compares.

If same:

  • Message is authentic.

Difference Between Hash and MAC

Hash MAC
No secret key Uses secret key
Integrity only Integrity + Authentication
SHA-256 HMAC-SHA256

Security of Hash Functions

A secure hash function must resist:

1. Preimage Attack

Finding original message from hash.


2. Second Preimage Attack

Finding another message with same hash.


3. Collision Attack

Finding two different messages with same hash.


Digital Signature

Provides:

  • Authentication
  • Integrity
  • Non-repudiation

Process:

Message
 ↓
Hash
 ↓
Encrypt with Private Key
 ↓
Digital Signature

Verification:

Public Key
 ↓
Verify Signature

Importance of Digital Signature

Used in:

  • E-commerce
  • E-governance
  • Online banking
  • Digital documents

Important Exam Questions

Short Questions

  1. What is AES?
  2. Why is AES better than DES?
  3. What is Triple DES?
  4. Define RC4.
  5. What is MAC?
  6. Define Hash Function.
  7. What is Digital Signature?
  8. Explain Collision Attack.

Long Questions

  1. Explain AES architecture and working.
  2. Compare AES, DES, and Triple DES.
  3. Explain Hash Functions and their security requirements.
  4. Discuss Message Authentication Code (MAC).
  5. Explain Digital Signature with diagram.
  6. Describe different block cipher modes.

Quick Revision

  • AES = Modern symmetric encryption standard.
  • DES = Old encryption standard.
  • Triple DES = DES applied three times.
  • RC4 = Stream cipher.
  • Hash Function = Fixed-size fingerprint of data.
  • MAC = Authentication + Integrity.
  • Digital Signature = Authentication + Non-repudiation.
  • SHA-256 = Popular secure hash algorithm.

Next Unit 5:

Malware, Virus, Worm, Trojan, Rootkit, Ransomware, Firewalls, OS Hardening, Antivirus, Digital Signature Standard (DSS), Authentication Protocols — usually asked directly in exams and viva.

Unit 3 — Public Key Cryptography and RSA

 

From MCA553 (Principles of Cryptography and Cyber Security). 


This is one of the most important units for exams.



---


Introduction to Cryptography


Cryptography is the science of protecting information by converting it into a secret form.


Goals of Cryptography


1. Confidentiality



2. Integrity



3. Authentication



4. Non-Repudiation





---


Plaintext and Ciphertext


Plaintext


Original readable message.


Example:


HELLO


Ciphertext


Encrypted unreadable message.


Example:


XKJ92A


Encryption


Converts plaintext into ciphertext.


Decryption


Converts ciphertext back into plaintext.



---


Symmetric Key Cryptography


Uses the same key for encryption and decryption.


Plain Text

    ↓

Encryption Key

    ↓

Cipher Text

    ↓

Decryption Key (Same Key)

    ↓

Plain Text


Advantages


Fast


Efficient


Suitable for large data



Disadvantages


Key distribution problem


Less secure for communication over open networks



Examples


DES


AES


Triple DES




---


Asymmetric Key Cryptography


Uses two different keys:


1. Public Key



2. Private Key




Public Key → Encrypt

Private Key → Decrypt


Advantages


Better security


Solves key distribution problem



Disadvantages


Slower than symmetric encryption



Examples


RSA


Diffie-Hellman


ECC




---


Difference Between Symmetric and Asymmetric Cryptography


Symmetric Asymmetric


One key Two keys

Faster Slower

Less secure key sharing More secure

DES, AES RSA, ECC




---


Message Authentication


Ensures that the message is genuine and has not been modified.


Methods:


Hash Functions


Digital Signatures


MAC (Message Authentication Code)




---


Public Key Cryptosystem Principles


Requirements:


1. Easy to generate key pair



2. Easy to encrypt



3. Easy to decrypt



4. Difficult to derive private key from public key



5. Difficult to recover plaintext without key





---


Diffie-Hellman Key Exchange


Used for securely sharing a secret key over an insecure network.


Steps


Suppose:


Prime number P = 23


Generator G = 5



Alice chooses:


a = 6


Bob chooses:


b = 15


Alice computes:


A = G^a mod P


Bob computes:


B = G^b mod P


They exchange A and B publicly.


Both calculate:


Secret Key = B^a mod P


and


Secret Key = A^b mod P


Result: Same secret key generated on both sides.



---


RSA Algorithm


Most important topic for exams.


RSA is based on:


> Difficulty of factoring large prime numbers.





---


RSA Key Generation


Step 1


Choose two prime numbers.


p = 3

q = 11


Step 2


Calculate:


n = p × q


n = 33



---


Step 3


Calculate:


φ(n) = (p−1)(q−1)


\phi(n)=(p-1)(q-1)


For this example:


φ(n) = 20



---


Step 4


Choose e such that:


1 < e < φ(n)


Choose:


e = 3



---


Step 5


Find d:


d × e ≡ 1 mod φ(n)


Result:


d = 7



---


Public Key


(e,n)

=

(3,33)


Private Key


(d,n)

=

(7,33)



---


Key Management


Process of:


Creating keys


Distributing keys


Storing keys


Revoking keys



Poor key management can break even strong encryption.



---


Symmetric Cipher Modes


Used to encrypt large amounts of data.


ECB


Electronic Code Book


Simple


Less secure



CBC


Cipher Block Chaining


More secure


Most commonly used



CFB


Cipher Feedback


OFB


Output Feedback



---


Substitution Technique


Replace characters with other characters.


Example:


A → D

B → E

C → F


Used in Caesar Cipher.



---


Transposition Technique


Characters remain the same but positions change.


Example:


HELLO

LHEOL



---


Block Cipher


Encrypts data block by block.


Example:


64-bit block

128-bit block


Popular Algorithms:


DES


AES




---


Data Encryption Standard (DES)


Developed by IBM.


Characteristics:


Symmetric algorithm


64-bit block size


56-bit key



Advantages


Fast



Disadvantages


Small key size


Vulnerable to brute force attack




---


Strength of DES


Originally strong.


Today:


Not secure enough


Can be cracked using modern computers




---


Differential Cryptanalysis


Studies differences in ciphertext to discover keys.


Purpose:


Break encryption algorithms




---


Linear Cryptanalysis


Uses linear relationships between plaintext and ciphertext.


Another method used to attack DES.



---


Block Cipher Design Principles


Good block cipher should have:


1. Confusion



2. Diffusion



3. Strong key management



4. Resistance to attacks





---


Important Exam Questions


Short Questions


1. Define Cryptography.



2. Difference between Symmetric and Asymmetric Encryption.



3. What is RSA?



4. What is Diffie-Hellman?



5. Define DES.



6. What is Ciphertext?



7. What is Key Management?



8. What is a Block Cipher?





---


Long Questions


1. Explain RSA algorithm with example.



2. Explain Diffie-Hellman key exchange.



3. Compare Symmetric and Asymmetric Cryptography.



4. Explain DES and its strengths.



5. Explain Differential and Linear Cryptanalysis.



6. Discuss block cipher design principles.





---


Quick Revision


Cryptography = Protecting information.


Symmetric = One key.


Asymmetric = Public + Private key.


RSA = Public key cryptography.


Diffie-Hellman = Secure key exchange.


DES = Symmetric block cipher.


Ciphertext = Encrypted message.


Key Management = Handling cryptographic keys.



Next Unit 4 covers AES, Triple DES, RC4, Hash Functions, MAC, and Message Authentication, which is also very important for university exams.