Module 2 Notes (DF)
Module 2 Notes (DF)
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Data Acquisition:
In digital forensics, data acquisition is the process of creating a forensically sound copy
of digital evidence from a suspect's storage media for the purpose of investigation. This
process is designed to ensure that the original evidence remains unaltered while providing
a bit-for-bit replica that can be analysed by investigators.
Understanding Storage Formats
In digital forensics, a storage format is a specific method used to package and store the
"bit-stream" data (an exact bit-for-bit copy) of an evidence drive. There are three primary
formats used in the industry: Raw, Proprietary, and Advanced Forensics Format (AFF).
1. Raw Format
The raw format is a basic, bit-by-bit copy of the original drive to a single file. It is most
famously created using the Linux dd ("data dump") command.
• Advantages: It is extremely fast, can ignore minor data read errors on the source
drive, and is compatible with almost all forensic analysis tools.
• Disadvantages: It requires exactly as much storage space as the original disk.
Furthermore, it does not include metadata (investigator info, timestamps), and its
validation hashes (MD5 or SHA-1) must be stored in a separate text file.
• Example: An investigator uses a Linux boot CD to run the dd command on a
suspect's 500GB hard drive. The result is a 500GB file on the investigator's drive
that is a "mirror" of the original, but the investigator must manually calculate and
save the MD5 hash in a notepad file to prove the data hasn't changed later.
2. Proprietary Formats
Proprietary formats are created by commercial forensic software vendors and offer
advanced features that raw images lack. The Expert Witness format (with file extensions
like .E01, .E02) is the unofficial industry standard, used by major tools like EnCase and
FTK.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
• Features: These formats can compress image files (often by 50% or more) and split
large images into smaller segments (like 650MB for CDs or 2GB for DVDs).
Crucially, they integrate metadata—such as the investigator's name, case number,
and hash values—directly into the image file itself.
• Disadvantages: It can be difficult to share these image files between different
forensic tools, and there are often size limitations for segmented volumes.
• Example: An investigator uses ProDiscover Basic to acquire an image. They
choose the proprietary format, which automatically splits the massive drive into
650MB segments with an .eve extension, saves a log file, and embeds the
investigator's "Joe Friday" name and case notes directly into the file's header.
3. Advanced Forensics Format (AFF)
AFF is an open-source storage format developed by Dr. Simson L. Garfinkel to provide
the benefits of proprietary formats without being tied to a specific commercial tool.
• Design Goals: It supports both compressed and uncompressed files, has no size
restrictions, and provides space for extensive metadata. It also includes internal
consistency checks for self-authentication.
• File Extensions: It typically uses .afd for segmented image files and .afm for
metadata.
• Example: A lab working on multiple operating systems (Linux, Windows, etc.)
uses AFF because it is open-source and compatible across different platforms. They
can image a multi-terabyte RAID system into a single AFF container, knowing that
the format's internal checks will notify them if any part of the data becomes
corrupted.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
• Logical Acquisition: This is used when time is limited or the evidence disk is
excessively large. It captures only specific files of interest to the case, such as
Outlook .pst or .ost email files.
• Sparse Acquisition: Also used for large drives under time pressure, this method
collects only selected portions of the data.
3. Key Decision Factors
The sources highlight several strategic considerations for choosing a method:
• Data Size and Time: If the disk is massive and time is short, logical or sparse
acquisitions are preferred. For extremely large data sets where size is the only
concern, tape backup systems can be an alternative, though they are slow.
• Legal Requirements: In civil litigation, a discovery order may require the return of
the original disk immediately after imaging. Because you often only have one
chance to get it right, it is critical to consult with a supervisor or attorney to
determine if a full bit-stream or just a logical copy is required.
• RAID Systems: If a RAID system is too large for static acquisition, investigators
should retrieve only relevant data using the sparse or logical method.
4. Contingency Planning and Best Practices
To ensure the integrity of the acquisition, investigators should follow these best practices:
• Redundancy: Always create a duplicate copy of the evidence image file and strive
to make at least two images using different tools or techniques.
• Hidden Data: Ensure you copy the host protected area (HPA) of a drive, which
may require specialized hardware tools that access the drive at the BIOS level.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
• Validation: Regardless of the method, always use a hashing algorithm (like MD5
or SHA-1) to verify that the image is an exact match of the original.
Practical Examples
Based on the guidelines in the sources, here are examples of how an investigator would
determine the best method:
Example 1: The Encrypted Laptop (Live Acquisition) An investigator arrives at a scene
where a laptop is powered on and uses Whole Disk Encryption.
• Method: The investigator performs a Live Acquisition.
• Reasoning: If they were to power it off for a static copy, they would need a
passphrase or recovery key to access the data later. By acquiring it live, they
capture the decrypted hard drive and volatile RAM data, which is becoming
increasingly important for investigations.
Example 2: The Large Corporate RAID (Logical/Sparse) An investigator is tasked with
collecting evidence from a company's RAID system that contains several terabytes of
data.
• Method: The investigator chooses a Logical Acquisition using a tool like
ProDiscover or EnCase.
• Reasoning: The system is too large for a full static bit-stream copy within the
allowed timeframe. Instead, they retrieve only the data relevant to the investigation,
such as specific employee email archives.
Example 3: The Aging Legacy Drive (Disk-to-Disk) An investigator is working with an
old computer from the 1990s that has a failing hard drive.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
• Method: They use a Bit-stream disk-to-disk method with a tool like SafeBack.
• Reasoning: Standard modern imaging tools fail to read the drive due to hardware
errors and geometry incompatibilities. SafeBack can adjust the target disk’s
geometry to match the suspect's drive, ensuring a successful copy where other
methods would fail.
Data acquisition tools and validation are the cornerstones of digital forensics,
ensuring that evidence is captured accurately and remains untampered for legal
proceedings.
Acquisition Tools
Forensic tools are categorized by their operating environment and specific
capabilities.
Windows-Based Tools:
o AccessData FTK Imager: A widely used tool that creates bit-stream images at both
the logical and physical drive levels. It requires a hardware write-blocker to
prevent the Windows OS from altering the suspect drive.
o ProDiscover Basic: This tool uses a proprietary format (.eve) that splits images into
650MB segments and integrates metadata like investigator name and case notes
directly into the file.
o EnCase Enterprise: A more advanced tool used for remote network acquisitions,
capable of capturing RAM and supporting a wide variety of file systems and RAID
configurations.
• Linux-Based Tools:
o dd (Data Dump): A standard Linux command that creates raw, bit-by-bit copies.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
While fast, it lacks forensic-specific features like progress bars or built-in hashing.
o dcfldd: A forensics-enhanced version of dd that can log errors, show progress in
bytes, and calculate multiple hashes simultaneously during the acquisition process.
o Forensic Live CDs: Distributions like Helix or Penguin Sleuth are used to boot a
suspect machine. They are designed to mount all drives as read-only, eliminating
the need for a hardware write-blocker.
• Specialised Hardware/Software:
o NTI SafeBack: An older but reliable MS-DOS tool that fits on a floppy disk and
performs an SHA-256 calculation for every sector copied.
o DIBS USA RAID: A portable hardware system specifically designed for forensic
disk-to-disk imaging.
How Acquisition Tools Work
o The mechanics of these tools center on two primary requirements: data preservation
and data replication.
o Write-Protection: When using Windows-based tools, it is mandatory to use a
hardware write-blocking device. Without this, the Windows OS will automatically
write data to the suspect drive (such as NTFS Journal or Recycle Bin entries) upon
booting, which corrupts the evidence. Forensic Linux Live CDs (like Helix) work
differently; they are configured to mount all drives as read-only by default, which
eliminates the need for a hardware write-blocker.
o Imaging Formats: Tools package the copied data into various formats. Raw format
(created by the Linux dd command) is a simple bit-stream copy. Proprietary formats
(like those used by ProDiscover or EnCase) allow for compression, file splitting
(e.g., into 650MB segments), and the integration of metadata such as the
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
investigator's name and case hash directly into the file.
o Validation (Hashing): Most tools calculate a unique digital fingerprint, or hash
(MD5 or SHA-1), for both the original drive and the new copy. If the two hashes
match exactly, the acquisition is validated as an authentic copy.
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Real-Time Experiment Example
To understand how these tools and methods interconnect, consider an investigator
performing a static acquisition of a suspect's desktop computer.
1. Preparation: The investigator documents the chain of evidence and removes the hard
drive from the suspect's computer.
2. Hardware Connection: They connect the suspect's drive to their forensic workstation
using a USB write-blocker.
3. Software Execution (FTK Imager):
o The investigator boots their workstation into Windows and starts FTK Imager.
o They select "Create Disk Image" and choose the "Physical Drive" option to
ensure they capture deleted files and unallocated space.
o They choose the Expert Witness (.E01) format to compress the data and enter
case metadata (e.g., Case #123, Investigator: Joe Friday).
4. Verification: Once the tool finishes the bit-stream copy, it automatically performs an
MD5 or SHA-1 hash of both the original drive and the resulting image file. The
investigator confirms the hashes match, ensuring the evidence is sound for court.
5. Contingency: Following best practices, the investigator creates a duplicate copy of
the evidence image file to serve as a backup
Validating data acquisitions
It is considered the most critical aspect of computer forensics because it ensures
that the evidence copy is an exact, bit-for-bit match of the original source. This
process relies on hashing algorithms, which create a unique numerical
"fingerprint" of the data.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Performing RAID data acquisitions
Performing RAID data acquisitions involves unique challenges compared to
standard drive imaging, primarily due to the complexity of how data is distributed
across multiple disks. RAID (Redundant Array of Independent Disks) is a
computer configuration involving two or more disks originally developed as a data-
redundancy measure.
Steps for Performing RAID Acquisitions
The sources outline several critical steps and considerations for a successful
acquisition:
1. Identify the RAID Type and Size: Determine which RAID level is in use and the
total storage capacity, as RAID systems now frequently contain terabytes of data.
2. Select a Compatible Forensic Tool: Choose a tool that can reconstruct the specific
RAID configuration. Vendors providing RAID functions include ProDiscover,
EnCase, X-Ways Forensics, and Runtime Software.
3. Evaluate Tool Capabilities: Ensure the tool can read a forensically copied RAID
image and handle split data saves from each individual RAID disk.
4. Determine Acquisition Method: If the system is too large for a full static
acquisition, investigators should use the sparse or logical acquisition method to
retrieve only the data relevant to the investigation.
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
• RAID 0 (Striped): This level provides rapid access and increased storage but lacks
redundancy Figure shows a 128 KB file being split into two 64 KB segments
distributed across Disk 1 and Disk 2.
• RAID 1 (Mirrored): Specifically designed for data recovery, it is more expensive
than RAID 0. Figure illustrates a 128 KB file being copied in its entirety to both
Disk 1 and Disk 2 simultaneously.
•
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
• RAID 2: Data is written at the bit level; it offers better integrity checking than
RAID 0 but is slower. Figure 4-11 depicts files being striped across three disks at
the bit level with a fourth disk dedicated to parity.
• RAID 3: This level utilizes data striping across the disks and employs a dedicated
parity disk for error recovery.
• RAID 4: In this configuration, data is written in blocks rather than at the bit level.
• RAID 5 (Block-level Striping with Distributed Parity): This level places parity
recovery data on each disk in the array. Figure 4-14 shows how file segments and
their corresponding parity blocks are rotated across four different disks.
Other mentioned levels include RAID 3 (striping with dedicated parity), RAID 4
(block-level writing), RAID 6 (redundant parity), and RAID 10 (a combination of
mirroring and striping).
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
• RAID 6: This level is designed for higher reliability by placing redundant parity
on each disk within the array.
• RAID 10 (Mirrored Striping): Also known as RAID 1+0, this is a combination
of RAID 1 and RAID 0, providing both the speed of striping and the redundancy
of mirroring.
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Limitations and Concerns
Acquiring RAID disks presents several specific limitations:
• Data Size: The massive amount of data (often terabytes) is the biggest concern,
making full images time-consuming and storage-heavy.
• Technical Challenges: Older hardware-firmware RAID systems can be
particularly difficult to image correctly.
• Tool Dependency: Investigators must verify if their forensic tool can accurately
read split data saves and reconstruct the specific RAID level used by the suspect.
• Static Acquisition Limits: Occasionally, a RAID system is simply too large for a
static acquisition, forcing the investigator to rely on less-comprehensive logical or
sparse methods.
Remote network acquisition tools
It is allow investigators to connect to a suspect’s computer over a network to
preview, search, and copy data without needing to be physically present at the
device. This method is particularly useful for corporate investigations or incident
response scenarios.
How it Works
Remote acquisition generally functions through a client-server model involving the
investigator’s workstation and the suspect’s computer:
• The Remote Agent: A specialized utility, such as the PDServer Remote Agent,
must be loaded onto the suspect’s computer. This can be done via a "Trusted CD,"
by IT pre-installation, or by "pushing" the agent out to the machine remotely over
the network.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
• Stealth Mode: To avoid alerting a suspect, these agents often feature a stealth
mode where they can change their process name to appear as a standard operating
system function.
• Encrypted Connection: Once the agent is active, the investigator establishes a
secure, encrypted connection to the suspect machine to perform the data collection.
• Live Acquisition ("Smear"): Because the suspect machine is running, the data
being copied is slightly altered during the process. This is often referred to as a
"smear" acquisition.
Key Tools and Their Capabilities
• ProDiscover Investigator: This tool allows for remote previews of drives while
they are in use, live acquisitions, and the ability to copy the suspect computer’s
RAM.
• ProDiscover Incident Response: This version adds advanced forensics
capabilities, such as capturing the volatile system state, analyzing currently
running processes, viewing active IP ports, and running hash comparisons to find
Trojans or rootkits.
• EnCase Enterprise: A robust tool that can remotely acquire media and RAM from
multiple systems simultaneously. It integrates with Intrusion Detection Systems
(IDS) and supports complex configurations like hardware or software RAID.
• Runtime Software: Provides shareware utilities like HDHOST to access network
computer drives and create raw or segmented image files.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Other Forensics Acquisition Tools
Several other specialized tools exist for specific needs:
• NTI SafeBack: A reliable MS-DOS tool that performs SHA-256 calculations for
every sector copied.
• DIBS USA RAID: A portable system designed specifically for forensic disk-to-
disk imaging.
• ASRData SMART: A Linux-based tool capable of robustly reading data from
drives with bad sectors.
• PyFlag: A network forensics tool that can create Expert Witness image files.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
rom any network connection. This prevents remote access, malware execution, or automatic system updates that could
modify the data.
Another important step is creating a forensic image, which is an exact bit-by-bit copy of the original storage device. This
copy includes all data, including deleted files, hidden files, and unused disk space. Investigators perform their analysis
on this copy instead of the original device to prevent any accidental modification.
To verify that the copied data is identical to the original, investigators generate hash values using algorithms such as
MD5 or SHA-256. If the hash value of the forensic copy matches the original, it confirms that the data has not been
altered.
A key concept in preservation is the Chain of Custody. This is a documented record that tracks every person who handled
the evidence, the time it was collected, how it was stored, and how it was transferred. Maintaining chain of custody
ensures transparency and integrity of evidence throughout the investigation.
3. Collection (Acquisition)
The Collection or Acquisition phase involves gathering digital evidence from identified sources andcreating forensic
copies for examination. This stage must be performed carefully because improper collection can damage or alter
evidence.
Digital evidence can be collected from many sources such as:
• Hard disk drives and solid-state drives
• USB flash drives and memory cards
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
• Smartphones and tablets
• Network devices and servers
• Cloud storage services
• System memory (RAM)
There are two main methods of acquiring digital evidence.
The first method is Live Acquisition. This method is used when the system is still running. Investigators collect volatile
data that would be lost if the system is turned off. Examples of volatile data include RAM contents, running processes,
open network connections, logged-in users, and encryption keys. Live acquisition is often used in cases involving
malware attacks, hacking incidents, and system intrusions.
The second method is Dead Acquisition. In this method, the device is powered off and investigators collect data directly
from the storage media. This approach is safer because it reduces the risk of altering data during the acquisition process.
During this stage, investigators use specialized digital forensic tools such as disk imaging tools, memory capture tools,
and mobile forensic tools to collect evidence. All collected evidence is properly labeled, documented, and stored in
secure containers to maintain its integrity.
4. Examination
The Examination phase involves processing the collected data to identify and extract relevant information related to
the investigation. Digital storage devices can contain millions of files, so investigators use forensic tools and techniques
to filter and organize the data.
During the examination stage, investigators perform tasks such as recovering deleted files, extracting
hidden data, analyzing file systems, and examining metadata. Deleted files are often recoverable because when a file
is deleted, the operating system usually removes the file reference but does not immediately erase the data from the disk.
Another important technique used in this stage is file carving, which involves recovering files based on known file
signatures even when the file system structure is damaged or missing. Investigators may also analyze email messages,
chat logs, browser history, registry files, and application logs to identify suspicious activities.
The examination process often includes keyword searches, where investigators search the entire data set for specific
words, phrases, or file names related to the case. This helps narrow down the evidence to relevant information.
The main objective of this phase is to extract useful evidence from a large volume of raw data.
5. Analysis
The Analysis phase is where investigators interpret the extracted data to understand the events that occurred during the
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
incident. The goal is to reconstruct the sequence of actions and determine how the crime was committed.
During this stage, investigators correlate evidence from multiple sources to answer important questions such as:
• Who performed the action?
• What activity occurred?
• When did the event happen?
• Where did the attack originate?
• How was the system compromised?
6. Documentation
Documentation is an essential part of every stage of the digital forensics investigation process. Investigators must
carefully record every action performed during the investigation to ensure transparency and accountability.
Proper documentation includes:
• Details of the investigation process
• Description of the devices examined
• Tools and software used during analysis
• Methods used to collect evidence
• Hash values and verification results
• Observations and findings
Documentation must be clear, accurate, and detailed so that another investigator could repeat the process and obtain
the same results. Good documentation also helps maintain the chain of custody and legal credibility of the investigation.
7. Presentation (Reporting)
The Presentation or Reporting phase is the final stage of the digital forensics investigation process. In this stage,
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
investigators present their findings in a clear and understandable format.
A digital forensic report typically includes:
• Introduction and background of the case
• Objectives of the investigation
• Methods and tools used
• Description of evidence collected
• Detailed analysis and findings
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Aspect Computer Forensics Cybersecurity Network Forensics Information Security
Focus Area Digital evidence on Security of systems, Data packets, network Protection of data and
devices such as applications, and logs, and information
computers, mobile networks. communication regardless of
phones, and between devices. where it is stored.
storage media.
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
what evidence availability of data.
exists.
Example Investigating a hacked Installing a firewall Analyzing network Encrypting company
Scenario computer to and antivirus to packets to detect a data and
recover deleted prevent Distributed Denial- controlling access
files and identify unauthorized of-Service (DDoS) to sensitive
the attacker. access. attack. information.
Computer Forensics, also called Digital Forensics, developed as a response to the rapid growth of computers and digital
technologies. As computers began to be used widely in businesses, government organizations, and personal
environments, criminals also started using them for illegal activities such as data theft, fraud, hacking, and unauthorized
system access. This created the need for specialized techniques to investigate digital crimes and collect electronic
evidence.
The history of computer forensics can be understood through several important milestones that contributed to the
development of this field.
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Example: Numeric Operations
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Sample program demonstrates real-life scenarios such as shopping, discounts, splitting bills, currency
notes, and interest calculation.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Output:
The round() function is used to format the decimal value in the last statement.
1. Operator Precedence
Operator precedence determines the order in which different operations are performed in a
mathematical expression. When an expression contains multiple operators, Python follows a set of rules
to decide which operation to perform first. Operators with higher precedence are evaluated before those
with lower precedence.
For example, in the expression:
Multiplication (*) has a higher precedence than addition (+), so Python first calculates 2 * 3 = 6 and then
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
adds 5, giving the final result as 11.
Precedence Table (Highest to Lowest):
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Characteristics of Strings:
1. Immutable: Once a string is created, it cannot be changed (modified). Any operation that alters a
string creates a new string instead.
2. Indexing: Each character in a string has a position (index), starting from 0 for the first character
and -1 for the last character when using negative indexing.
3. Slicing: A substring can be extracted using slicing (string[start:end]), where start is the beginning
index (inclusive) and end is the stopping index (exclusive).
4. Concatenation: Strings can be combined using the + operator.
5. Repetition: A string can be repeated multiple times using the * operator.
6. Escape Characters: Special characters like \n (newline) and \t (tab) can be used inside strings to
format text properly
Examples of String Representation:
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
String Indexing:
• Out-of-range indexes will cause an error. Trying to access text[6] in "Python" will result in an
IndexError.
• Both positive and negative indexing can be used interchangeably. For example, text[0] and
text[-6] both refer to 'P'.
• Indexing is useful for accessing single characters, while slicing (using :) helps extract substrings
efficiently.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
String Slicing in Python
String slicing is a technique used to extract a portion (substring) of a string. It follows the syntax:
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
• text[-4:] extracts characters from index -4 ('s') to the end.
• text[:-3] extracts characters from the start up to index -3 ('Mys'), excluding -3.
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
1. Using the + Operator
The + operator is the simplest way to join two or more strings.
Syntax:
This method joins the given strings without adding any extra spaces. If a space is required, it must be
explicitly added.
Example:
Here, " " (space) is added between first_name and last_name to maintain proper formatting.
2. Using the += Operator (Concatenation with Assignment)
The += operator appends a string to an existing string variable.
Example:
Here, " to Bangalore!" is appended to "Welcome", modifying the original message variable.
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Here, " ".join(words) joins all elements in the list with a space (" ") between them.
f-strings are the most efficient and readable way to concatenate strings.
Trying name + " scored " + score would result in a TypeError because score is an integer.
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Examples of String Concatenation
Creating an Email Template
3. String Formatting
String formatting in Python allows us to create well-structured and readable text by dynamically inserting
values into strings. Instead of manually concatenating strings and variables, formatting provides a cleaner
and more efficient way to include variables within a string. Python offers multiple ways to format strings,
including the .format() method and f-strings (formatted string literals). f-strings (introduced in Python
3.6) are the most preferred method due to their simplicity and performance. String formatting is widely
used in output messages, reports, and dynamic text generation
1. Using .format()
Using .format() for String Concatenation
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
The .format() method in Python is a versatile way to insert values into a string. It is useful for
concatenating strings, formatting numbers, and creating structured outputs dynamically.
Basic Syntax
Curly brackets {} act as placeholders, and the .format() method replaces them with specified values.
1. Basic Example
Here:
• {2} → "large one"
• {0} → "bigger"
• {1} → "small one"
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Example 2: Student Grade Report
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
2. Formatting Numbers with f-strings
(a) Formatting Decimal Places
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Example 3: Student Grade Report
CO
Questions
Level
Define a variable in Python and give an example. 1
List any four data types available in Python. 1
Identify the output of print(10 / 3) and print(10 // 3). 1
Recall the order of operations in Python for +, -, *, /, //, %, **. 1
Describe what string indexing is and how negative indexing works in Python. 1
State the difference between string concatenation and string slicing with examples. 1
Recall how .format() is used for string formatting with an example. 1
Identify the output of name = "Amit"; print(f"My name is {[Link]()}"). 1
Explain how f-strings work and why they are preferred over .format(). 1
Define a variable in Python and give an example. 1
Explain the difference between integer and float data types in Python with an example. 2
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
Discuss the concept of string indexing and demonstrate accessing individual characters 2
using positive and negative indices.
Describe how string slicing works in Python and provide an example. 2
Show how string concatenation is performed in Python and explain it with a real-time 2
example.
Compare .format() and f-strings for string formatting with suitable examples.
Implement a Python program to declare variables of different data types (integer, float, 3
string) and print their values.
Construct an expression using different arithmetic operators and explain the order of 3
execution based on operator precedence.
Develop a Python program to perform all arithmetic operations (+, -, *, /, //, %, **) on two 3
given numbers.
Use string indexing to extract and print the first, middle, and last character from the given 3
string: "Bangalore"
Apply string slicing to extract and print only the domain name from the email 3
"[Link]@[Link]".
Modify a given string "Hello World" to "Hello Python" using string concatenation. 3
Write a program using .format() to display a formatted bill receipt containing product 3
name, quantity, and total price.
Construct a Python script using f-strings to generate a personalized greeting message based 3
on user input.
Implement a program that takes a user's full name and prints their first and last name 3
separately using string slicing.
Apply f-string formatting to display a formatted student grade report with name, subject, 3
and marks scored.
Examine how Python dynamically handles different data types when assigning values to 4
variables.
Compare the behaviour of integer and float division in Python, and determine in which 4
Srishyla Education Trust ®
GM UNIVERSITY
(Established under the Karnataka State Act No. 19 of 2023)
Post Box no-4, PB Road, Davangere-577006
FACULTY OF ENGINEERING AND TECHNOLOGY
School of Computer Science and Technology
scenarios floor division is preferable.
Differentiate between operator precedence and associativity in Python arithmetic 4
expressions, using an example.
Investigate how string indexing works with both positive and negative indices, and explain 4
the advantages of using negative indexing.
Examine how slicing a string in Python differs from indexing, and evaluate its impact on 4
memory efficiency.
Compare string concatenation methods in Python, and determine which method is optimal 4
in terms of performance and readability.
Analyze the output of the given Python expression using operator precedence: 10 + 2 * 3 ** 4
2 // 4 - 5.
Investigate how .format() and f-strings handle string formatting differently, and justify why 4
f-strings are considered more efficient.
Examine a real-time example where f-strings provide better readability and maintainability 4
over traditional concatenation.
Analyze the importance of using explicit data type conversion in numeric operations and 4
identify potential errors that may occur without it.