AKTU_Semester_Exam_Guide_Java_CyberSecurity
AKTU_Semester_Exam_Guide_Java_CyberSecurity
Unit I OOP & Core Java Architecture Inheritance, Interfaces, Abstract Classes, Packages, 15 Marks
JVM Memory
Unit II Exception Handling & Memory Exception Hierarchy, Custom Exceptions, Try-With- 12 Marks
Management Resources, GC
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 1 of 22
Unit Module Topic Core Focus Areas Exam
No. Weightage
Unit III Multithreading & Concurrency Thread Life Cycle, Synchronization, Inter-thread 18 Marks
Control Communication, Deadlocks
Unit Java I/O, Socket Programming & Byte/Char Streams, Serialization, TCP/UDP Sockets, 15 Marks
IV Steganography LSB Steganography
Unit V Cyber Security Frameworks & CIA Triad, Botnet Architectures, Ransomware, 20 Marks
Threat Vectors Wireless Security (WPA3)
Unit AKTU Solved Question Bank 15 Short Answer Questions & 6 Long Analytical Model Test
VI University Questions
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 2 of 22
UNIT I: OBJECT-ORIENTED TECHNOLOGIES & JAVA
FUNDAMENTALS
Classes, Abstraction, Polymorphism, Memory Model & Package Architecture
• Encapsulation: Wrapping code and data together into a single unit (class). It is achieved by declaring fields as private
and providing public getter and setter methods. Encapsulation ensures data hiding and security against unauthorized
direct modification.
• Abstraction: Hiding internal implementation details and highlighting operational functionality to the end user. In Java,
abstraction is achieved using abstract classes (0–100%) and interfaces (100% abstract up to Java 7).
• Inheritance: The mechanism by which one class acquires the properties and behaviors of a parent class. It promotes
reusability via the extends keyword. Java supports single, multilevel, and hierarchical inheritance, but prohibits direct
multiple inheritance for classes to eliminate the Diamond Problem.
• Polymorphism: The capability of a method to perform different tasks based on the invoking context.
◦ Compile-time Polymorphism (Method Overloading): Multiple methods in the same class sharing the same name but
possessing different parameter signatures (type, count, or order).
◦ Run-time Polymorphism (Method Overriding): Subclass providing a specific implementation of a method already
defined in its superclass. Resolved at runtime via Dynamic Method Dispatch.
Multiple Inheritance Not supported (Single class inheritance only) Supported (A class can implement multiple
interfaces)
Member Variables Can have instance variables (private, Only public static final constants
protected, public)
Default / Static Supported fully Supported since Java 8 (default & static)
Methods
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 3 of 22
1.3 JVM Memory Architecture & Lifecycle
When Java code executes, the Java Virtual Machine (JVM) divides memory into five primary logical runtime data areas:
1. Class (Method) Area: Stores per-class structures such as the runtime constant pool, field and method data, and the code
for methods and constructors.
2. Heap Area: The runtime data area from which memory for all class instances (objects) and arrays is allocated. Managed
automatically by Garbage Collectors.
3. Stack Area: Stores frames holding local variables, partial results, and nested method invocations. Each thread has its own
private JVM stack created simultaneously with the thread.
4. PC Register: Contains the address of the JVM instruction currently being executed by the thread.
5. Native Method Stack: Contains all the native methods used in the application written in C/C++.
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 4 of 22
UNIT II: EXCEPTION HANDLING ARCHITECTURE & MEMORY
MANAGEMENT
Throwable Hierarchy, Try-Catch-Finally, Custom Exceptions & Garbage Collection
Checked Exception (excluding Checked at compile-time. Mandatory to handle using try-catch or declare with th
Exceptions RuntimeException) IOException, SQLException, ClassNotFoundException.
Unchecked RuntimeException Occur at runtime due to logical errors or improper API usage. Not checked by compil
Exceptions NullPointerException, ArrayIndexOutOfBoundsException, ArithmeticE
Errors Error Irrecoverable conditions caused by system environment issues. Programs should no
Examples: OutOfMemoryError, StackOverflowError.
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 5 of 22
// Example: Try-With-Resources & Custom Exception Handling
import [Link];
import [Link];
import [Link];
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 6 of 22
UNIT III: MULTITHREADING & CONCURRENCY CONTROL
Thread Lifecycle, Synchronization, Inter-Thread Communication & Deadlock Prevention
NEW Thread object instantiated via new Thread() Not yet started. Memory allocated on Heap.
WAITING Invoked wait(), join(), or Waits indefinitely until another thread calls
[Link]() notify() or notifyAll().
TIMED_WAITING Invoked sleep(ms), wait(ms), or join(ms) Waits for a specified duration or until explicit
notification/interruption.
TERMINATED run() method completes execution or throws Thread execution finished. Dead state. Cannot be
uncaught exception restarted.
3.3 Thread Creation Mechanisms: Thread Class vs. Runnable vs. Callable
Java provides three primary mechanisms for thread creation:
1. Extending [Link]: Limits inheritance because Java does not support multiple class inheritance.
2. Implementing [Link]: Recommended standard. Separates task logic from thread execution
mechanism. Cannot return values or throw checked exceptions.
3. Implementing [Link]<V>: Advanced approach. Returns a result of type V via
Future<V> and can throw checked exceptions.
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 7 of 22
// Example: Producer-Consumer Model illustrating Inter-Thread Communication
import [Link];
import [Link];
class Buffer {
private final Queue queue = new LinkedList<>();
private final int CAPACITY = 5;
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 8 of 22
UNIT IV: JAVA I/O SYSTEMS, NETWORKING &
STEGANOGRAPHY
Streams, Object Serialization, TCP Sockets & LSB Information Hiding
• Byte Streams (8-bit bytes): Abstract superclasses are InputStream and OutputStream. Used for reading/writing
binary data (images, compiled audio, executable files). Primary concrete classes: FileInputStream,
FileOutputStream, BufferedInputStream.
• Character Streams (16-bit Unicode characters): Abstract superclasses are Reader and Writer. Designed specifically
for text processing, supporting automatic character encoding conversion (e.g., UTF-8, UTF-16). Primary classes:
FileReader, FileWriter, BufferedReader, PrintWriter.
• To render an object serializable, its class must implement the marker interface [Link].
• serialVersionUID: A unique identifier used during deserialization to verify that the sender and receiver of a
serialized object have loaded classes for that object that are compatible.
• transient Keyword: Variables marked as transient are excluded from the serialization process. Used for sensitive
data (e.g., passwords, secret keys) or non-serializable fields (e.g., thread handles, socket instances).
• TCP Socket (Connection-Oriented): Uses ServerSocket on the server side and Socket on the client side.
Guarantees reliable, ordered byte delivery.
• UDP Datagram (Connectionless): Uses DatagramSocket and DatagramPacket. Faster transmission with no
packet delivery guarantees.
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 9 of 22
// Conceptual Java Code: LSB Image Steganography Embedding Routine
import [Link];
bitIndex++;
if (bitIndex == 8) {
bitIndex = 0;
msgIndex++;
}
}
}
return coverImage;
}
}
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 10 of 22
UNIT V: FUNDAMENTALS OF CYBER SECURITY & THREAT
VECTORS
CIA Triad, Criminal Profiles, Malware Taxonomy & Botnet Detection
1. Confidentiality: Ensuring that sensitive data is accessible only to authorized entities. Enforced via encryption, access
control lists (ACLs), and multi-factor authentication.
2. Integrity: Safeguarding the accuracy, completeness, and immutability of information against unauthorized modification or
tampering. Enforced via cryptographic hash functions (SHA-256) and digital signatures.
3. Availability: Ensuring that network services and data remain accessible to authorized users when required. Protected via
redundant systems, load balancers, and DDoS mitigation frameworks.
4. Non-Repudiation: Ensuring that a sender cannot deny having sent a message or initiated an action. Enforced using public-
key cryptography and digital signatures.
Black-Hat Financial gain, extortion, cyber Exploits zero-day vulnerabilities, deploys ransomware,
Hackers espionage compromises databases.
White-Hat Ethical testing, defense, vulnerability Authorized penetration testing, bug bounties, security audit
Hackers patch compliance.
Hacktivists Political, ideological, or social activism Website defacement, Distributed Denial of Service (DDoS),
leaking sensitive documents.
Nation-State Geopolitical advantage, warfare, Advanced Persistent Threats (APTs), industrial cyber
Actors infrastructure sabotage sabotage (e.g., Stuxnet).
Insider Threats Revenge, financial bribery, negligence Privileged user abuse, unauthorized data exfiltration, logic
bomb planting.
• Centralized C2 Topology (IRC / HTTP): All bots connect directly to a central Command & Control server. Easy to set
up, but creates a Single Point of Failure (SPOF). Defended by shutting down the central IP/domain.
• Peer-to-Peer (P2P) Topology: Bots communicate with each other using decentralized P2P protocols (e.g., Kademlia).
Commands propagate neighbor-to-neighbor, making structural disruption significantly more difficult for law enforcement.
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 11 of 22
5.4 Botnet Detection Strategies
1. Signature-Based Detection: Inspects known network signatures, payload patterns, or file hashes. Ineffective against
encrypted traffic or zero-day command structures.
2. Anomaly-Based / Flow Monitoring: Analyzes netflow metrics (packet rates, unusual periodic outbound heartbeats, DNS
query spikes for Fast-Flux domains). Employs Machine Learning algorithms (Random Forest, SVM) to detect deviations
from baseline network traffic.
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 12 of 22
UNIT VI: NETWORK, WIRELESS & DEVICE PROTECTION
MECHANISMS
Firewalls, IDS/IPS, Wi-Fi Security Protocols (WPA2/WPA3) & Rogue AP Mitigation
• Packet Filtering Firewall (Stateless): Operates at OSI Layer 3/4. Inspects packet headers (source/destination IP, ports,
protocol) against static rules. Fast but lacks context awareness.
• Stateful Inspection Firewall: Tracks active TCP connection states in a state table. Verifies that incoming packets
correspond to legitimate, established outbound sessions.
• Next-Generation Firewall (NGFW) / Application Layer: Operates at OSI Layer 7. Performs Deep Packet Inspection
(DPI), user identification, and integrated intrusion prevention.
• IDS (Intrusion Detection System) vs. IPS (Intrusion Prevention System): IDS passively monitors network traffic and
alerts administrators upon detecting suspicious signatures. IPS is placed inline and actively blocks or drops malicious
traffic streams in real time.
WEP RC4 (Stream CRC-32 Obsolete / Broken. Weak 24-bit IV reuse allows key recovery in
Cipher) minutes.
WPA2- AES-CCMP (Block CBC-MAC Vulnerable to offline dictionary attacks on 4-way handshake and
Personal Cipher) KRACK retransmission exploits.
WPA3- AES-128 BIP / GMAC Current Standard. Replaces 4-way handshake with SAE
Personal (GCMP-128) (Simultaneous Authentication of Equals) to stop offline dictionary
attacks.
• Mitigation Strategy: Deploying Wireless Intrusion Detection Systems (WIDS) with distributed sensor probes, enforcing
802.1X Extensible Authentication Protocol (EAP-TLS), and implementing Port Security (MAC limiting) on switch
interfaces.
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 13 of 22
UNIT VII: CRYPTOGRAPHIC FOUNDATIONS & DIGITAL
SIGNATURES
Symmetric vs Asymmetric Encryption, SHA-256 Hashing, PKI & Digital Signatures
Key Management Single Shared Secret Key for both Key Pair: Public Key (Encryption) + Private Key
encryption and decryption (Decryption)
Computational Extremely fast, low CPU overhead Slow (~1000x slower than symmetric due to
Speed modular exponentiation)
Key Exchange Requires secure out-of-band channel to Public key can be freely distributed over
Problem exchange shared key untrusted networks
• Pre-image Resistance (One-Way): Computationally infeasible to derive input M from given hash H(M).
• Second Pre-image Resistance: Given M_1, it is infeasible to find M_2 such that H(M_1) = H(M_2).
• Collision Resistance: Infeasible to find any two distinct inputs M_1 eq M_2 such that H(M_1) = H(M_2).
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 14 of 22
UNIT VIII: AKTU MODEL EXAM PAPER - PART A (2-MARK
SHORT QUESTIONS)
15 Model Short Questions with Precise Model Solutions
Q1. State two differences between Abstract Class and Interface in Java. 2 Marks
Answer: (1) An abstract class can hold instance fields and non-final fields, whereas interface fields are implicitly
public static final. (2) A class can extend only one abstract class, but can implement multiple interfaces.
Answer: Dynamic Method Dispatch is the mechanism by which a call to an overridden method is resolved at runtime
rather than at compile time. It is used to implement runtime polymorphism via superclass reference variables pointing to
subclass objects.
Answer: throw is used to explicitly throw an exception object inside a method body (e.g., throw new
IOException()). throws is used in the method signature to declare exceptions that the method might propagate.
Q4. What is the role of the transient keyword in Java serialization? 2 Marks
Answer: The transient modifier prevents specific class variables from being written to the byte stream during
serialization, protecting sensitive data such as passwords.
Answer: Synchronization prevents race conditions when multiple concurrent threads attempt to read and write to shared
mutable resources simultaneously, ensuring thread safety and data consistency.
Answer: The CIA Triad comprises Confidentiality (restricting data access to authorized entities), Integrity (protecting
data from unauthorized alteration), and Availability (ensuring timely, reliable access to services).
Q7. What is a Botnet and what is a Command & Control (C2) server? 2 Marks
Answer: A Botnet is a network of compromised machines infected with malware. A C2 server is the centralized or P2P
infrastructure used by the botmaster to issue commands to all bots.
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 15 of 22
Q8. Explain LSB Steganography in digital image files. 2 Marks
Answer: LSB Steganography replaces the least significant bit of pixel color bytes with secret message bits, concealing
the hidden data with imperceptible impact on visual appearance.
Answer: WPA2 uses a 4-way handshake vulnerable to offline dictionary attacks. WPA3 replaces it with SAE
(Simultaneous Authentication of Equals) protocol, offering stronger protection against dictionary attacks even with weak
passwords.
Answer: A Rogue Access Point is an unauthorized wireless access point installed on a secure network without
administrator knowledge, creating a backdoor into the private network.
Answer: Non-repudiation ensures that a transacting party cannot deny the authenticity of their signature on a document
or the sending of a message, typically proven using public key digital signatures.
Q12. What is the difference between Stateful and Stateless Firewalls? 2 Marks
Answer: Stateless firewalls inspect individual packets independently based on static rules. Stateful firewalls track TCP
connection states in a state table to validate whether incoming packets belong to active established streams.
Answer: Symmetric encryption uses a single shared secret key for both encryption and decryption. Asymmetric
encryption uses a mathematically linked key pair: a public key for encryption and a private key for decryption.
Answer: A GC Root is an anchor object accessible from outside the heap (e.g., active thread local variables, static
variables, active JNI handles) from which GC object reachability graphs originate.
Q15. Explain the purpose of `wait()` and `notify()` methods in Java. 2 Marks
Answer: `wait()` causes the executing thread to release its monitor lock and wait until another thread calls `notify()` or
`notifyAll()` on the same object monitor.
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 16 of 22
UNIT IX: AKTU MODEL EXAM PAPER - PART B & C (10-MARK
LONG QUESTIONS)
Long Analytical Questions with Complete Structural Solutions & Code
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 17 of 22
Q16. [10 Marks] Explain the Java Thread Life Cycle in detail with a state transition diagram. Write a
complete multi-threaded program demonstrating thread synchronization using synchronized blocks.
A Java thread undergoes state transitions during its lifecycle. The [Link] enum defines six
distinct states:
1. NEW: The thread instance is created but start() has not been called.
2. RUNNABLE: Executing in the JVM or waiting for OS CPU scheduling allocation.
3. BLOCKED: Waiting to acquire a monitor lock held by another thread.
4. WAITING: Indefinitely waiting for another thread to perform an action (via wait() or join()).
5. TIMED_WAITING: Waiting for a specified timeout period (via sleep(ms) or wait(ms)).
6. TERMINATED: Standard completion of run() method or exit due to unhandled exception.
[Link]();
[Link]();
}
}
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 18 of 22
Q17. [10 Marks] What are Botnets? Explain the Command and Control (C2) topologies (Centralized vs
Peer-to-Peer). Discuss network-based and anomaly-based techniques for detecting botnet activity.
Comprehensive Solution:
C2 Architecture Analysis:
• Centralized Architectures (IRC/HTTP): Bots establish outbound connections to fixed C2 servers or dynamic
domains via Fast-Flux DNS. While latency is low and control is immediate, law enforcement can disrupt the botnet
by sinkholing the central IP domain.
• Peer-to-Peer (P2P) Architectures: Nodes act as both clients and servers. Command payloads propagate overlay
routing graphs (e.g., Storm, Kademlia). Taking down individual nodes fails to collapse the botnet network.
Detection Frameworks:
1. Flow-Based Traffic Analysis: Examining NetFlow metrics for high-volume periodic outbound beaconing,
synchronized IRC/HTTP requests across internal hosts, and high rate of failed DNS queries.
2. Machine Learning Anomalies: Training supervised models (Decision Trees, Random Forests) on packet header
characteristics (inter-arrival packet time, payload entropy, flow duration) to isolate botnet communications from
legitimate background traffic.
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 19 of 22
Q18. [10 Marks] Describe the Least Significant Bit (LSB) image steganography technique. Write a
Java algorithm or pseudo-code to embed and extract binary payload data in an uncompressed BMP/
PNG image.
Technical Breakdown:
LSB steganography leverages spatial domain image processing. An RGB image stores 24 bits per pixel (8 bits Red, 8
bits Green, 8 bits Blue). The least significant bit (bit 0) represents a numerical weight of 2^0 = 1 in decimal. Modifying
bit 0 changes total luminance by at most 0.39%, rendering changes invisible.
if (bitIdx == 8) {
extractedBytes[byteIdx] = currentByte;
byteIdx++;
bitIdx = 0;
currentByte = 0;
}
}
}
return new String(extractedBytes);
}
}
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 20 of 22
Q19. [10 Marks] Explain Wireless Network Security Protocols (WEP, WPA2, WPA3). Describe the Evil
Twin attack scenario and detail enterprise countermeasures.
Wireless security evolved due to vulnerabilities in radio broadcast media. WEP relied on weak initialization vectors and
RC4 stream ciphers. WPA2 introduced AES-CCMP and 4-way handshakes, but remained vulnerable to dictionary
attacks and KRACK. WPA3 integrates SAE (Simultaneous Authentication of Equals) to provide forward secrecy and
resist offline dictionary attacks.
An attacker sets up an Access Point broadcasting the exact SSID of a target corporate network. By sending forged
802.11 Deauthentication packets to legitimate clients, the attacker forces clients to disconnect and reconnect to the Evil
Twin AP, enabling Man-in-the-Middle (MitM) traffic interception.
Countermeasures: Deploying 802.1X EAP-TLS certificate authentication, dynamic VLAN assignment, and Wireless
Intrusion Prevention Systems (WIPS).
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 21 of 22
UNIT X: EXAM QUICK REVISION SUMMARIES & FORMULA /
ARCHITECTURE SHEET
High-Yield Summary Tables, Code Pitfalls & Final Exam Strategy
Process vs Thread Process has dedicated Threads share heap within Confusing stack memory with
memory space same process shared heap
Byte vs Char Stream InputStream/OutputStream Reader/Writer (16-bit Using Byte streams for reading
(8-bit) Unicode) text encodings
WEP vs WPA3 RC4 with static key / 24-bit SAE Handshake with Assuming WPA2 is immune to
IV Forward Secrecy dictionary attacks
Symmetric vs AES / Fast / Single Key RSA / Slow / Key Pair Using RSA for large payload
Asymmetric video/file encryption
AKTU Semester Exam Guide | Advanced Java & Cyber Security Page 22 of 22