LATEST Project Defense Copy2 Copy - 111942
LATEST Project Defense Copy2 Copy - 111942
INTRODUCTION
1.1 Background of the Study
The digital revolution has transformed the global landscape of information exchange, shifting
society from traditional paper-based communication to fast, automated digital transmission.
Today, government, corporations, security agencies, and individuals depend on digital
platforms to send and receive confidential information across geographically distributed
environments. The expansion of the internet, cloud computing, and mobile technologies has
increased data accessibility and enabled real-time communication. However, the same
advancement has brought about heightened risks of cyber-attacks, including data interception,
unauthorized disclosure, and digital espionage (Stallings, 2017). Sensitive information
transmitted online can be intercepted, altered, or completely compromised by adversaries,
making data security a key concern in modern digital ecosystems.
In digital image steganography, numerous techniques have been proposed to achieve high
data embedding capacity while preserving image quality. One of the earliest and most widely
adopted techniques is the Least Significant Bit (LSB) substitution method. LSB
steganography modifies the least significant bits of pixel values in an image to store hidden
1
binary data. Although easy to implement and capable of preserving reasonable visual quality,
LSB methods suffer critical weaknesses (Fridrich, 2009). Even slight modifications in
compression, cropping, or scaling can destroy the hidden message due to LSB’s minimal
robustness. Additionally, steganalysis tools employing statistical analysis can easily detect
abnormalities introduced by LSB embedding, limiting its applicability in secured real-world
communications (Dumitrescu, Wu, & Wang, 2003).
As cyber threats continue to evolve and data transmission becomes increasingly frequent,
there is a compelling need to implement stronger, more stealthy security technologies for
communication. The growing field of intelligent surveillance and automated attack systems
further heightens the demand for secure methodologies that conceal both the presence and
structure of sensitive information. Thus, research into BPCS-based steganography plays a
crucial role in developing the next generation of secure file-sharing systems capable of
supporting national security, corporate operations, digital rights management, and personal
privacy.
In view of the above, this study explores the implementation of a secure file sharing system
that combines encryption with BPCS steganography to enhance confidentiality, capacity, and
resilience against detection. Through experimental comparison with conventional techniques
such as LSB, the research aims to demonstrate BPCS as a more reliable and scalable solution
for modern secure communication needs.
Objectives
1. To rigorously implement the Bit-Plane Complexity Segmentation (BPCS) steganography
algorithm tailored for embedding complex data payloads into digital images.
2. To conduct an extensive evaluation of the embedding capacity of BPCS steganography
across multiple image formats and resolutions, determining the optimal parameters for
maximum payload without degradation of image quality.
3. To evaluate the robustness and security of the embedded data against a variety of attack
vectors and steganalysis techniques, including statistical attacks and machine learning
classifiers.
4. To develop and validate algorithms for accurate extraction and recovery of embedded files,
ensuring data integrity and minimizing error rates under diverse operational conditions.
5. To design a comprehensive and intuitive user interface that facilitates secure file
embedding, transmission, and extraction, supporting multiple platforms and ensuring ease of
use for end-users with varying technical expertise.
3
1.4 Significance of the Study
In the contemporary digital landscape, the significance of secure file sharing cannot be
overstated. With the rapid proliferation of internet usage and digital communication, sensitive
data is frequently transmitted over public and private networks, making it vulnerable to
interception, unauthorized access, and manipulation. The study on securing file sharing using
Bit-Plane Complexity Segmentation (BPCS) steganography is therefore highly relevant and
impactful, addressing crucial gaps in the field of information security, particularly in covert
communication and data protection.
The study concentrates on lossless image formats such as Bitmap (BMP) and Portable
Network Graphics (PNG) for the cover media. These formats are deliberately chosen due to
their ability to retain exact pixel data without compression-induced loss, which is essential for
preserving the integrity of embedded information during the embedding and extraction
processes (Uchida et al., 2005). Unlike lossy formats such as JPEG or HEIC, which apply
compression algorithms that alter pixel values and thus may corrupt or degrade hidden data,
BMP and PNG provide stable environments suitable for steganographic applications
(Fridrich, 2009).
4
Despite the promising capabilities of BPCS steganography, several notable limitations
circumscribe the scope and practical application of the developed secure file sharing system.
These limitations stem from both technical constraints and environmental assumptions
inherent in the research.
1. Dependency on Cover Media Format and Quality
The system’s reliance on lossless image formats, while advantageous for data integrity,
results in significantly larger file sizes compared to lossy compressed formats commonly
used in everyday digital communications.
2. Embedding Capacity Constraints
Although BPCS steganography exploits complex bit-plane segments to achieve higher
embedding capacity than traditional methods like Least Significant Bit (LSB) substitution, its
capacity is not unlimited.
3. Vulnerability to Advanced Steganalysis
Security in steganography is not solely about hiding data but also about evading detection by
adversaries. While BPCS offers improved imperceptibility by leveraging bit-plane
complexity, it is not immune to sophisticated steganalysis techniques.
Following the theoretical groundwork, the report explores the design and implementation of
the proposed system. It identifies a security vulnerability, describes how such an attack
typically occurs, and proposes a mitigation strategy. The methodology section details how
data was collected, pre-tested, cleaned, and classified for training and testing purposes. A
suitable machine learning algorithm was selected to support analysis, with model evaluation
based on accuracy, precision, recall, and F1-score.
Information Security:
5
A field of cybersecurity concerned with protecting data from unauthorized access,
modification, or disclosure while ensuring confidentiality, integrity, and availability are
preserved.
Steganography:
A covert communication technique used to hide the existence of secret information within a
digital cover medium such as an image, audio, or video file, ensuring that unauthorized
parties cannot detect hidden data.
Cover Image:
The original digital image used as a medium for embedding secret data without exhibiting
noticeable changes to human observers.
Stego-Image:
The resulting image after embedding encrypted or concealed information into the cover
image using steganography techniques.
Payload:
The confidential information such as documents, text, or files that is embedded within a cover
image during steganography.
Encryption:
A cryptographic process that converts readable information (plaintext) into an unreadable
form (ciphertext) to prevent unauthorized access, even if interception occurs during data
transmission.
AES-256 Encryption:
A widely used and highly secure symmetric encryption standard that uses a 256-bit key to
ensure strong protection of data before embedding.
Embedding Capacity:
The maximum amount of data that can be securely hidden within a cover image without
degrading its visual quality or raising suspicion of tampering.
Data Integrity:
6
A security principle that ensures embedded or extracted information remains complete,
original, and unaltered throughout the storage, embedding, transmission, and recovery
process.
CHAPTER TWO
LITERATURE REVIEW
2.1 Conceptual framework
2.1.1 Overview and purpose
The conceptual framework for this study establishes a coherent structure that links high-level
information-security objectives to the concrete technical components and evaluation criteria
of a secure file-sharing system based on Bit-Plane Complexity Segmentation (BPCS)
steganography. At the highest level, the framework conceives secure file sharing as a two-
layer protection problem in which cryptographic encryption is used to protect the content of a
file and steganography is used to conceal the very existence of that encrypted content. This
layered perspective responds directly to the classical goals of information security
confidentiality, integrity and availability by ensuring that content is unreadable without the
key (confidentiality), that extracted files can be verified as unmodified (integrity), and that
the system remains usable under normal operational conditions (availability) (Whitman &
Mattord, 2018). The present study operationalizes these objectives into implementable
components and measurable evaluation axes to produce a replicable and testable design
blueprint.
The study adopts AES-256 as the primary encryption mechanism before embedding and
selects BPCS as the steganographic engine because of its capacity and imperceptibility
advantages for lossless image covers (Stallings, 2017; Kurosawa, Uchida, & Tanaka, 1996).
These specific choices are reflected in the project implementation and experimental setup
described elsewhere in this thesis (see project implementation notes and experimental
settings).
Each functional component is associated with acceptance tests and logging points so that
failures are observable and reproducible. For example, integrity verification at recovery
provides a binary signal (pass/fail) that informs whether further error-control measures are
needed. The modular view also clarifies responsibilities: encryption secures content, while
BPCS steganography secures concealment; neither alone suffices for the study’s threat model,
which assumes adversaries can both inspect transfers and attempt extraction if detection
occurs.
This process view also clarifies how design trade-offs propagate: increasing embedding
capacity may increase detectability and sensitivity to image transformations; adding
redundancy and error correction improves recoverability but reduces effective payload
capacity; choosing lossless cover formats preserves fidelity but may be impractical in
bandwidth-constrained contexts. By making these interdependencies explicit, the framework
provides a rationale for empirical parameter sweeps and for reporting results along consistent
axes.
12
Shannon’s entropy principles and complexity theory, providing a strong academic foundation
for the methodology and experiments conducted in later chapters.
2.3.1 “Secret data sharing through coverless video steganography based on bit plane
segmentation” Debnath, Mohapatra & Dash (2023)
Debnath et al. (2023) propose a coverless video steganography method that uses bit-plane
segmentation across video frames instead of direct bit-replacement embedding. The method
extracts frames, decomposes them into bit-planes, and computes stable per-block hash/feature
sequences used as retrieval keys; secret data are mapped to these features rather than being
written into the bitstreams themselves. The empirical evaluation included common attacks
(noise, cropping, resizing, recompression) and showed improved robustness to many
manipulations compared with single-frame BPCS embedding, at the expense of a different
operational model (requires pre-shared mapping or retrieval database). This paper is
important because it demonstrates a practical alternative to fragile bit-replacement BPCS
when robustness is a priority (Debnath, Mohapatra, & Dash, 2023).
13
2.3.3 “Steganography: Combination of Least Significant Bit (LSB) and Bit-Plane
Complexity Segmentation (BPCS) methods for hiding message on image and
audio” Rizal et al. (2023)
Rizal et al. (2023) experimentally implement a hybrid application that combines LSB and
BPCS techniques to hide messages in both images and audio. Their empirical tests report
successful extraction and acceptable perceptual quality metrics for a variety of payload sizes
and cover types. The study illustrates practical engineering decisions (block sizes,
conjugation bookkeeping) and shows that combining methods can be used to balance
capacity and robustness in constrained environments (Rizal, Rahmatulloh, Widiyasono,
Ruuhwan, & Nursamsi, 2023).
2.3.4 “Image steganography using bit plane complexity segmentation” Htun (2020)
Htun (2020) presents an applied study of classic BPCS embedding on standard image sets,
reporting experiments that evaluate embedding capacity, PSNR/SSIM values, and simple
steganalysis resistance (statistical checks). The paper reaffirms that BPCS, on lossless image
formats, achieves significantly higher embedding capacity relative to LSB while maintaining
acceptable visual fidelity when complexity thresholds are carefully chosen (Htun, 2020).
2.3.6 “Deep Learning Based Image Steganalysis” survey & model evaluations (2023–
2024)
Multiple empirical papers since 2020 evaluate CNN-based detectors (SRNet variants, Xu-
Net, Yedroudj-Net) on contemporary stego methods. These papers include empirical
evaluations of detection accuracy as a function of embedding rate and post-processing
(compression, resizing). They consistently show that detectors trained with augmentation
(compression, scaling) maintain higher detection rates against adaptive embedding strategies.
Representative experimental papers and preprints from 2022–2024 provide architectures and
14
training recipes that can be used as adversarial testbeds in evaluation (e.g., SRNet analyses,
Xu-Net replications).
16
Highlights
Steganalysis of High detection
Agarwal et weaknesses of Only evaluates
12 context-aware of contextual
al., 2022 context-rich limited methods
methods patterns
embedding
Acceptable Defines
Medical image
Magdy et security domain- Lacks practical
13 steganography
al., 2022 practices for specific deployment statistics
review
healthcare requirements
Improved Optimises
Abdullah More usable
complexity BPCS Metadata overhead
14 (Series), complex
measures for performance increases
2021–2024 blocks
BPCS factors
A second gap concerns robustness: while BPCS delivers high usable payloads and good
visual fidelity when lossless cover formats are used, empirical evidence demonstrates that
extraction success and data integrity often degrade sharply under lossy compression and
typical image manipulations (Uchida, Kurahashi, & Kurosawa, 2005; Htun, 2020). The
majority of capacity-focused studies therefore evaluate performance in idealised, lossless
settings, leaving open the question of how to retain practical payloads and reliable recovery
rates when stego images traverse real-world channels (social platforms, messaging services)
that routinely apply recompression and resizing.
17
Closely related is the problem of adversarial evaluation. The rapid improvement of deep-
learning steganalysis models has shifted the empirical baseline for “detectability.” Techniques
that once evaded handcrafted statistical detectors are increasingly exposed by convolutional
detectors trained on representative cover/stego datasets and augmented transforms (De La
Croix et al., 2024; Deng et al., 2022). However, many recent BPCS and hybrid-system papers
omit rigorous adversarial testing against such modern detectors or only report limited results,
creating a blind spot: claims of low detectability are not fully validated against the most
capable practical adversaries.
The present study addresses these gaps by adopting a comprehensive, reproducible evaluation
protocol that reports embedding capacity, PSNR and SSIM, extraction success after
18
controlled lossy transforms (multiple JPEG quality levels, resizing and cropping), detection
performance against contemporary CNN steganalysers with augmentation, and runtime plus
metadata overhead for conjugation bookkeeping. In addition, the study explores error-control
(forward-error-correction and redundancy) and lightweight metadata compression schemes to
improve robustness, and it includes a small domain case study to surface practical constraints.
All code, parameter settings, and experiment scripts will be made available to support
reproducibility and comparison with future work
CHAPTER THREE
3.0 RESEARCH METHODOLOGY
This chapter explains how the secured file-sharing system was designed, implemented and
evaluated. It presents the overall research strategy, the threat model that motivates design
decisions, the attacks and mitigation patterns tested, the data and experimental setup,
implementation details, and the metrics and analysis methods used to draw conclusions. The
approach is empirical and engineering-focused: construct an artifact (AES-256 + BPCS
pipeline), measure its behaviour under controlled conditions, and use those measurements to
answer the research questions about capacity, imperceptibility, robustness and detectability.
19
modern steganalysis methods. Experiments are automated, logged, and repeated to estimate
variability.
Choosing this three-phase design provides clear reasoning: baselines validate measurement,
modular construction supports controlled experiments, and systematic evaluation produces
data-driven conclusions.
In conventional systems, encryption is typically the primary line of defense against such
threats. While strong cryptographic algorithms can protect the confidentiality of data,
encrypted files remain visible as high-value targets during transmission and storage.
Attackers may attempt to capture these files for offline analysis, key recovery attempts, or
future exploitation. Moreover, when weak, outdated, or improperly implemented
cryptographic schemes are used, adversaries can sometimes bypass or brute-force the
protection mechanisms. Even when strong encryption is employed, the mere presence of
encrypted data can raise suspicion and attract targeted attacks.
Accordingly, the specific attack identified in this study is the interception and analysis of
sensitive files during transmission, leading to unauthorized disclosure or manipulation. By
integrating BPCS steganography with AES-256 encryption, the proposed system does not
only aim to make data unreadable, but also to make its presence inconspicuous. This shifts
the defensive strategy from merely “protecting the content” to also “hiding the
communication,” thereby reducing the likelihood that the data will be noticed, targeted, or
subjected to further attacks in the first place.
3.3 Attack Pattern Design
To guide the design of effective countermeasures, this study models the typical sequence of
actions an adversary may follow to compromise sensitive files shared over a network when
no steganographic protection is employed. This attack pattern represents a simplified but
realistic lifecycle of data interception and misuse in file-sharing scenarios. Understanding this
sequence helps to justify the integration of both encryption and steganography in the
proposed system.
Attack Pattern: Data Interception in File Sharing
1. Target Scanning and Network Monitoring
The attacker monitors network traffic or scans communication channels to identify
file transfers of interest. This may involve passive packet sniffing on public networks
or active probing of cloud and email services.
2. Man-in-the-Middle (MITM) Setup
The adversary positions themselves between the sender and the receiver, or
compromises an intermediate node, enabling the capture or redirection of transmitted
files without the knowledge of either party.
3. Data Interception and Extraction
The transmitted files are captured and stored by the attacker. If the files are encrypted,
they may be flagged for further cryptanalysis or offline analysis.
4. Payload Analysis or Data Tampering
The attacker attempts to analyze the intercepted data, exploit weak encryption, or
modify the content before forwarding it to the intended recipient, potentially causing
data corruption or malicious injection.
5. Exfiltration or Monetization
Finally, the extracted information may be exfiltrated, sold, leaked, or otherwise
exploited for financial, political, or strategic gain.
21
This attack pattern illustrates that traditional file-sharing systems primarily expose the
existence of valuable data, even when encryption is applied. The proposed AES-256 + BPCS
approach directly targets the early stages of this attack chain by concealing the presence of
sensitive data within ordinary-looking images, thereby reducing the probability of
interception, analysis, and subsequent exploitation.
22
Step-by-step mitigation workflow
1. Payload preparation and hashing
Compute a cryptographic integrity tag (for example SHA-256 or HMAC) over the original
file and attach this tag to the payload. This enables the receiver to detect tampering after
extraction and before decryption.
2. Encryption (AES-256)
Encrypt the prepared payload (payload + integrity tag) using AES-256 in a suitable
authenticated mode (e.g., GCM) or combine AES with an HMAC. Encryption ensures that
even if an adversary extracts embedded data, the contents remain confidential and
indistinguishable from random noise.
3. Optional forward-error-correction (FEC) and fragmentation
Optionally apply an FEC code (e.g., Reed-Solomon) or fragment the ciphertext across
multiple images. Improves recoverability after lossy transformations (recompression,
cropping) at the cost of some capacity.
4. BPCS embedding with conjugation bookkeeping
Decompose the cover image into bit-planes and partition each plane into fixed-size blocks
(typical baseline: 8×8). Compute a normalized complexity metric for each block and select
only complex (noise-like) blocks for substitution. If a ciphertext block is not complex, apply
a deterministic conjugation transform and record its location in the conjugation map.
Compress the conjugation map (gzip/RLE/bit-pack) and embed it (either in reserved blocks
or distributed across the cover images). Embedding in complex blocks preserves
imperceptibility and reduces statistical artifacts relative to naive LSB replacement.
5. Stego-image transmission
Transmit the stego-image over the network as a normal image file. The image should appear
visually and statistically consistent with ordinary images to lower the chance of triggering
detection systems.
6. Receiver extraction and verification
Extract the conjugation map, recover embedded ciphertext blocks (reverse conjugation where
required), apply FEC decoding if used, verify the integrity tag, and finally decrypt the
ciphertext using the shared AES key. Reason: end-to-end checks ensure integrity and guard
against silent corruption or tampering
For a binary block B of size m×m the block complexity is computed by counting transitions
between adjacent bits in both horizontal and vertical directions. Concretely, let H be the total
number of horizontal transitions (the sum, over every row, of adjacent bit pairs that differ)
and let V be the total number of vertical transitions (the sum, over every column, of adjacent
24
bit pairs that differ). The maximum possible number of transitions in an m×m block is
2·m·(m − 1). We therefore define the normalized block complexity C(B) as
H +V
C (B)=
2 ×m ×(m−1)
which yields a value in the interval [0, 1]. Blocks whose complexity meets or exceeds a
chosen threshold T are classified as complex and are eligible for substitution by ciphertext
blocks. In the experiments reported in this thesis the threshold T is varied in the range {0.25,
0.30, 0.35, 0.40, 0.45} with a commonly used baseline of T ≈ 0.30–0.40 in line with prior
BPCS work. The complexity measure and thresholding step are applied identically during
embedding and at extraction for block classification reproducibility.
When a ciphertext block to be embedded is itself simple (that is, its internal complexity is
below the required threshold), a deterministic conjugation transform is applied so that the
payload block appears noise-like and can be substituted into a complex cover block without
perceptual mismatch. The conjugation used in experiments is an XOR with a fixed
checkerboard mask M (alternating ones and zeros), although other deterministic masks may
be evaluated. A conjugation flag is recorded for every payload block that is transformed; the
collection of these flags forms the conjugation map, which is required for correct inversion
during extraction.
Because the conjugation map can be large relative to the payload and therefore reduce
effective capacity or introduce detectable structure, the map is compressed prior to
embedding. Two lightweight encodings are used experimentally: run-length encoding (RLE)
for sparse flag patterns and general-purpose lossless compression (gzip/DEFLATE) for
denser patterns; variants also test bit-packing to represent flags compactly. The compressed
conjugation map is itself treated as auxiliary data: it may be embedded in designated robust
locations within the same stego-image (for example, reserved high-complexity blocks),
distributed across multiple images to avoid concentration, or split and replicated to increase
recoverability at the cost of capacity.
25
The embedding workflow therefore proceeds as follows. The payload is first prepared
(integrity tag appended, AES-256 encrypted, and optionally FEC-encoded and fragmented),
then partitioned into blocks sized to match the embedding unit. For each payload block, a
target complex cover block is chosen according to the deterministic selection policy; if the
payload block is simple it is conjugated and the conjugation map updated. After all payload
blocks are placed, the conjugation map is compressed and embedded according to the chosen
metadata strategy. The resulting stego-image is written in a lossless format and logged with
full provenance information including the conjugation-map size and the exact list of block
indices used.
Extraction reverses the embedding steps in a symmetric manner. The receiver decomposes the
received stego-image into bit-planes and blocks, computes per-block complexity and
enumerates the same candidate sequence of complex blocks (using the shared seed when
pseudo-random selection was used). Embedded blocks are extracted in the recorded order;
the compressed conjugation map is recovered and decompressed, and any conjugated payload
blocks are XORed with the mask M to restore their original bit patterns. If FEC was applied,
decoding occurs at this stage to correct errors introduced by lossy transformations; integrity
verification is then performed by checking the appended hash/HMAC. Only when integrity
verification succeeds is the ciphertext decrypted with the shared AES key to recover the
original payload.
Random Forest is chosen as the baseline detector because it handles mixed feature types
robustly, offers straightforward interpretability through feature importance measures, and has
modest computational cost relative to deep models. The Random Forest hyperparameters
explored during model selection include the number of trees n ∈ {50, 100, 200} and
maximum tree depth max_depth ∈ {10, 20, None}. Training follows a stratified data split
with 70% of examples used for training, 20% reserved for testing, and 10% held out for
validation; within the training partition, hyperparameter tuning is performed using stratified
10-fold cross-validation to avoid overfitting and ensure stable estimates. Performance is
reported comprehensively: accuracy, precision, recall, F1-score, and ROC/AUC for
probability-producing detectors are presented alongside confusion matrices; calibration
curves and selected operating points (thresholds) are included when practical to translate
detector scores into actionable alerts. Final models are persisted using joblib with versioned
filenames that embed the parameter settings and dataset manifest, and feature importance
reporting is retained with the saved model to support post-hoc analysis of which descriptors
most influence detectability.
To assess robustness against stronger adversaries, selected experiments also evaluate modern
convolutional neural network (CNN) steganalyzers. These adversarial-detector experiments
require larger training sets and augmentation to avoid overfitting; therefore the methodology
prescribes augmentation regimes that include recompression, resizing and mild noise
transforms to emulate likely real-world variability. CNN training includes standard best
practices such as training/validation splits, early stopping, learning-rate schedules, and
monitoring for overfitting; GPU acceleration is used for these experiments and hardware
requirements are documented in the appendix. For both Random Forest and CNN
experiments, special care is taken to avoid cover-source mismatch: separate cover collections
are held out as independent test sets and class balance is maintained during sampling. All
training runs log random seeds, hyperparameters, training curves and final model checkpoints
so that results can be reproduced exactly.
27
Finally, the verification module is integrated into the experimental reporting pipeline:
detector performance is evaluated across the full parameter sweep (complexity threshold,
block size, metadata encoding, embedding rate) and reported as detection curves (AUC vs.
embedding rate), along with tabulated metrics at representative operating points. Where
detectors indicate elevated detection risk, those parameter regions are annotated and used to
inform recommendations about safe operational embedding settings.
Figure 3.2: Python integration of image processing, encryption, ML, and ETL modules.
At the start of the pipeline, images are ingested and normalized by the image-processing
module. This module is implemented in Python using OpenCV and Pillow, and exposes a
small set of deterministic functions: load_image(path) → Image, preprocess(image, config)
→ image, and decompose_bitplanes(image) → planes. These functions perform lossless
conversion, canonical resizing, channel/byte-order normalization and the bit-plane
28
decomposition required by BPCS. The resulting bit-planes and per-block complexity map are
the canonical inputs to the embedding routine.
The BPCS embedding module consumes the ciphertext and the precomputed complexity
map. It implements the block-selection, conjugation and compressed conjugation-map
embedding strategies described in §3.6 and provides a small API such as embed(ciphertext,
planes, config, seed) → stego_image, embed_metadata. The embedding function returns both
the stego-image and a compact provenance object that records block indices used,
compressed metadata size, runtime and a checksum. Importantly, the embedding module
separates the policy for selecting embedding locations from the low-level bit operations so
that selection policies (deterministic scan, seeded pseudo-random selection, or prioritized
high-complexity selection) can be swapped without changing the embedding primitives.
For verification and detectability assessment, the machine-learning module is invoked after
embedding (and optionally after extraction). It exposes extract_features(image) →
feature_vector and classify(features, model) score,label. The production baseline uses a
trained Random Forest persisted with joblib; adversary-grade experiments can call a CNN
inference routine if a GPU is available. All model inferences and feature vectors are logged
with their model version and seed to ensure traceability of results.
Operational logging and ETL are handled by a lightweight telemetry module that
standardizes metadata produced by each step into a structured JSON record. After embedding
or extraction, these records (containing provenance, metric values, runtime, and checksums)
are exported to Apache NiFi where extract-transform-load flows convert them into CSV
artifacts and push them into the analytics layer. Power BI is used as the visualization front
end in our experimental setup; the NiFi→CSV→PowerBI pipeline supports interactive
dashboards for capacity, PSNR/SSIM distributions, recovery rates, and detector performance
over parameter sweeps. All ETL transformations are versioned scripts so the dashboard can
be regenerated from raw logs.
29
Exception handling and data integrity are enforced at module boundaries. Each major
function returns a status code and an auditable provenance object; failures trigger controlled
rollback or retry policies (for example, if embedding cannot place the full payload in a single
image, the pipeline will either fragment the payload automatically or raise a deterministic
error recorded in the log). Cryptographic keys are never written to logs; only non-sensitive
key identifiers and key-usage metadata are recorded. For experiments that require key
exchange, the pipeline assumes a secure out-of-band channel for key provisioning and
records only the key ID and key derivation parameters used.
Finally, a simple Tkinter prototype GUI was developed to demonstrate how the core
functions can be invoked from a front end. The GUI is intentionally lightweight: it calls the
same core APIs used by the scripts (load_image, encrypt_payload, embed, extract, classify)
and only mediates user input and event handling. Because the GUI uses the same APIs, it
does not introduce new logic or attack surface in experiments; it serves as a usability
demonstrator rather than a production interface.
Repository and artifacts. All code, experiment manifests, and (where licensing permits) data
manifests are published to a versioned repository. Large datasets are referenced by canonical
links (e.g., BOSSbase mirror) and checksums so others can obtain identical inputs. The
methodology requires documentation of hardware (CPU/GPU, RAM), OS and Python
versions.
Reproducibility practices. Deterministic seeds for random sampling, explicit logging of
configuration per run, and automated generation of experiment reports are required. The
methodology prescribes publishing an experiment manifest and a reproducibility checklist
with each reported result in Chapter Four.
32
CHAPTER FOUR
IMPLEMENTATION, RESULT AND DISCUSSION
4.1 Implementation
This chapter presents the practical realization of the secure file-sharing system proposed in
this study and discusses the experimental results obtained from its evaluation. The
implementation phase translates the conceptual architecture and algorithms described in the
previous chapters into a functional, reproducible software prototype. The system was
developed in Python due to the availability of mature libraries for image processing,
cryptography, data handling and machine learning, as well as its portability across common
research platforms.
To ensure reproducibility, the development environment was fully versioned, including the
operating environment and all library dependencies. All input images were normalised to a
fixed resolution before embedding in order to eliminate inconsistencies caused by varying
source image sizes and formats. The entire system was organised as a modular pipeline with
clearly defined interfaces between components, allowing individual modules to be tested,
replaced or extended without affecting the rest of the system.
At the highest level, the pipeline begins with payload preparation and encryption. The secret
file is first processed to compute an integrity checksum and then encrypted using AES-256 in
an authenticated mode, ensuring both confidentiality and integrity protection. The encryption
stage produces a ciphertext stream together with the required cryptographic parameters,
33
which are stored in the experiment metadata for traceability. The encrypted data is then
segmented into fixed-size blocks that match the block structure used by the BPCS embedding
process. An optional redundancy stage can be enabled at this point when robustness against
lossy transformations is being evaluated.
The BPCS module is responsible for bit-plane decomposition, block segmentation and
complexity analysis. Each cover image is decomposed into its constituent bit-planes, and
each plane is divided into non-overlapping blocks. For every block, a complexity value is
computed based on the number of horizontal and vertical bit transitions, and this value is
normalised to fall within a fixed range. Blocks whose complexity exceeds the chosen
threshold are marked as eligible for data substitution. All parameters used in this process,
including block size and complexity threshold, are recorded for each experimental run.
When a payload block has low complexity and would introduce visible artefacts if embedded
directly, the system applies conjugation using a fixed checkerboard pattern. The fact that a
block has been conjugated is recorded in a conjugation map. To minimise metadata overhead,
this map is compressed using a lightweight encoding scheme before being embedded into
reserved high-complexity regions of the image. The embedding process then replaces
selected complex blocks with payload blocks and reconstructs the stego image. The final
output of this stage is the stego image together with a detailed provenance record containing
payload size, number of blocks used, metadata size and runtime.
The extraction process is implemented as the exact inverse of embedding. The stego image is
decomposed into bit-planes, the reserved regions are read to recover and decode the
conjugation map, and any conjugated blocks are restored to their original form. The
ciphertext stream is then reassembled and verified using the stored integrity information
before decryption. To guarantee correctness, the system performs a hash comparison between
the original payload and the extracted file for every successful run, and the result is written to
the experiment log.
From a performance perspective, the implementation prioritises clarity and correctness while
still applying basic optimisations. Bit-plane operations and complexity calculations are
vectorised using numerical libraries to avoid unnecessary overhead. On the development
hardware, typical embedding and extraction operations complete within seconds for standard
image sizes. Execution times, memory usage and system specifications are logged for each
run to ensure that performance claims are supported by measured data. For large
experimental sweeps, the orchestration layer supports parallel execution across multiple CPU
cores to reduce total runtime.
Figure 4.1 illustrates the interaction between the main software modules and shows how
encryption, BPCS embedding, feature extraction and logging are combined into a single
coherent pipeline.
35
Figure 4.1: Code snippet demonstrating integration of core modules
36
The cover corpus for experiments is drawn from the BOSSbase v1.01 benchmark. For the
LSB baseline fifty images were selected at random using a fixed seed; these fifty images
form the canonical set used to demonstrate the limits of naive spatial embedding for
encrypted payloads. For the full BPCS parameter sweeps a larger, stratified corpus was used
to represent different content families: images were assigned to low, medium and high
complexity tiers using the same per-block complexity metric defined in Chapter Three, and
for each experimental condition at least thirty images from each tier were processed so that
per-condition statistics reflect content variability rather than idiosyncrasies of particular
images. Payloads were synthetic or publicly available sample files in four target sizes (≈5
KB, 25 KB, 50 KB, 100 KB) so experiments cover both light and heavy embedding regimes.
In all cases the payloads were encrypted with AES-256 prior to embedding, meaning that
ciphertext not cleartext was embedded, which replicates the realistic use case of protecting
content before concealment.
Each experimental run is specified by a compact parameter set. The primary BPCS factors
swept in experiments were block size (8×8, 16×16), complexity threshold (T = 0.25, 0.30,
0.35, 0.40, 0.45), payload size, and forward-error-correction level (0%, 10%, 20%
redundancy). To probe robustness, post-processing transforms were applied deterministically
according to the run configuration: JPEG recompression at quality factors 90, 70 and 50;
downscaling to 50% of original dimensions; cropping a 10% border; and additive Gaussian
noise at two severity settings. These transforms were applied both in isolation and in
controlled combinations so the impact of single and compound transforms could be separated
in analysis. All transform parameters are recorded in the run manifest so any reported
extraction failure can be traced to exact conditions.
Detection and verification experiments were designed to generate training and evaluation
data in a way that avoids cover-source mismatch and preserves representative class balance.
Feature vectors were computed for both clean and stego images using the same routines
described in Chapter Three, and datasets were partitioned with a stratified split that preserves
the proportions of complexity tiers and payload densities. The default split used for detector
experiments was 70% training, 20% test and 10% validation; hyperparameter tuning relied on
ten-fold cross-validation within the training fold. Random Forest hyperparameters were
explored over modest grids and the final models were persisted along with cross-validation
metrics and confusion matrices. When convolutional neural steganalysers were used for
adversarial evaluation, training followed the same stratification but additionally applied an
augmentation policy (recompression and scaling variants) to model realistic variability; GPU
resources were reserved for these runs and augmentation details are recorded in each run
manifest.
37
To characterise run-to-run variability, every experimental condition was executed multiple
times under controlled randomness. Deterministic decisions use an explicit random seed and
stochastic steps that could introduce non-determinism (for example, multi-threaded IO) were
repeated with multiple seeds where needed. For the factorial grid described above, every
combination of block size, threshold, payload size and FEC level was evaluated on at least
thirty image instances; a subset of more computationally expensive combinations (for
example, heavy FEC with severe recompression and CNN adversary) were repeated five
times to produce robust variance estimates. Summary statistics reported in Chapter Four
therefore present means together with standard deviations and, where appropriate, confidence
intervals.
Measurement and logging were designed to support rigorous statistical analysis. For each run
the orchestration layer computes perceptual metrics (PSNR and SSIM), an extraction success
flag (binary), round-trip integrity (hash match between original payload and decrypted
payload), conjugation map size (bytes), net usable payload after metadata and FEC overhead,
embedding and extraction times (ms), and detector outputs (probabilities and binary
decisions). These per-run metrics are written as timestamped CSV records and linked to the
archived raw artefacts (stego images, extracted payloads and configuration JSON). The
statistical analysis plan, prepared before executing experiments, specifies parametric tests
(ANOVA) when assumptions are met and non-parametric alternatives (Kruskal–Wallis)
otherwise; significant omnibus tests are followed by post-hoc comparisons with correction
for multiple testing. Regression models are used to characterise continuous trade-offs for
example, modelling detection probability as a function of payload size, complexity threshold
and conjugation density. All analysis scripts are reproducible notebooks saved in the
repository so the same statistical results can be regenerated from the archived outputs.
Hardware and software environments were treated as explicit experimental factors. The
majority of runs were executed on an Intel-class workstation with 16 GB RAM; runs that
required heavier computation (CNN training) used a GPU-enabled workstation or cloud
instance. Each run manifest records the exact machine specification (CPU, GPU, RAM,
operating system and library versions) so results obtained on different machines can be
compared meaningfully. Deterministic seeds, environment files and versioned code ensure
that runs performed on different hardware remain comparable.
To aid transparency and reviewer inspection, the experimental grid, transform definitions and
planned run counts are summarised in accompanying tables (parameter grid, transform table,
and run-count table). The test plan also defines pass/fail and acceptance criteria used in the
38
results discussion: an embedding/extraction is considered successful only when the decrypted
payload matches the original exactly by hash; acceptable imperceptibility for baseline
lossless experiments is operationally defined as PSNR > 30 dB and SSIM > 0.90 (noted as
heuristic thresholds rather than rigid rules). Detection resilience is assessed from detector
ROC curves and detection rates at chosen false positive operating points; for deployment
recommendations the system is considered useful where it achieves acceptable capacity and
imperceptibility while maintaining detection probability below an operational threshold under
the expected adversary model. These decision rules are implemented in the analysis
notebooks so that runs can be classified reproducibly into success, marginal and failure
categories.
4.3 Results
This section presents the empirical findings from the pre-test baseline and the full BPCS
experimental campaign. The narrative links measured outcomes to the experimental
conditions and highlights the trade-offs established in the research design. Numeric
summaries are shown where they succinctly illustrate the behaviour; detailed raw numbers
are available in the run manifests and CSV metric files in the project repository..
The practical conclusion is that naive LSB embedding is unsuitable for embedding larger
encrypted payloads in realistic file-sharing scenarios. Any practical system must either
severely limit payload size or adopt embedding strategies that exploit cover-content structure
a gap addressed by BPCS.
Capacity varied strongly with the intrinsic complexity of the cover image. High-complexity
images regularly accommodated net usable payloads at or above 25 KB after accounting for
conjugation-map overhead, whereas low-complexity images supported much smaller net
payloads without perceptual degradation. Adjusting the complexity threshold produced
predictable trade-offs: higher thresholds reduced the number of eligible blocks and therefore
lowered capacity while improving imperceptibility and reducing the statistical footprint
available to detectors; lower thresholds increased capacity but required more conjugation
(and therefore larger metadata) to avoid visible mismatch.
Changing block size to 16×16 reduced relative metadata overhead for very large payloads but
slightly reduced PSNR for equivalent payloads, since substituting larger blocks produces
more coarse-grained local changes. Overall, round-trip extraction fidelity in lossless
conditions was high: integrity checks passed in over 95% of moderate-payload runs, with the
few failures typically traceable to I/O or implementation issues rather than algorithmic limits.
Geometric transforms (downscale to 50%, cropping of edge regions) produced alignment and
indexing problems that corrupted extraction unless conjugation-map placement included
spatial redundancy. Embedding the conjugation map in multiple reserved locations and
combining that with FEC improved recoverability for geometric damage, again at the cost of
net usable payload. Additive noise produced moderate degradation that FEC could mitigate in
many runs.
In short, BPCS is a strong choice for controlled or lossless channels and tolerates light,
common transforms; for lossy or adversarial channels meaningful payloads require careful
redundancy and metadata design, or hybrid embedding approaches that place essential
metadata in more robust domains.
41
Detection experiments using a Random Forest trained on engineered features revealed that
detectable statistical differences between cover and stego images do persist under many
configurations. In runs with large, balanced training sets and moderate-to-high embedding
densities, the Random Forest produced high accuracy (mid-90% range) and strong
precision/recall. Performance declined modestly when training data were smaller or
embedding density was lower, reflecting the detector’s sensitivity to the strength of the
statistical signal.
Stronger convolutional neural steganalysers trained with augmentation (recompression,
scaling, cropping) often outperformed the Random Forest on the same tasks, demonstrating
that modern data-driven detectors, when trained under realistic variability, can detect stego
images that a simpler classifier might miss. These findings underscore a central conclusion:
covertness must be evaluated against detectors that match the expected sophistication of real
adversaries. Operational parameter selection (thresholds, embedding density, metadata
engineering) should therefore be guided by the anticipated detector cost and capability;
conservative settings reduce detection risk but also reduce capacity.
.
4.4 Discussion
The results of this study reveal a practical and instructive distinction between simple spatial-
domain embedding and the more advanced Bit-Plane Complexity Segmentation (BPCS)
approach. By examining imperceptibility, embedding capacity, robustness under distortion,
and vulnerability to automated detection, the experiments tie observed behaviour directly to
the system goals set out earlier and show where BPCS delivers genuine advantages and
where it requires careful engineering.
The LSB pre-test behaved as theory predicts. At very low embedding rates LSB can preserve
perceptual quality, but even modest increases in payload produce rapid drops in PSNR and
SSIM and crucially a large rise in detectability. Because this work embeds encrypted
ciphertext (high-entropy data), the low-order bit-planes become perturbed in ways that
modern steganalysis readily exploit. In short, LSB is fragile for the practical use case
considered here: covert transfer of multi-kilobyte encrypted files. It only remains acceptable
for tiny, low-risk payloads.
BPCS, by design, addresses many of those limitations. When ciphertext is placed into
inherently noisy, high-complexity bit-plane regions, perceptual quality is preserved at
payloads that would break LSB. This alignment between noise-like ciphertext and noise-like
cover regions explains why human observers and many heuristic detectors struggle to
distinguish BPCS stego images from their covers, and why round-trip extraction succeeds
42
reliably in lossless channels. Capacity is therefore not an abstract metric but a cover-
dependent resource: textured, high-complexity images offer substantially more usable space
than smooth images, and BPCS allows systems to exploit that variability in ways LSB
cannot.
At the same time, the experiments make clear that BPCS is not a universal remedy. Spatial-
domain embedding remains sensitive to geometric distortion and heavy lossy recompression.
Severe JPEG re-encoding, aggressive downscaling and cropping break block alignment and
corrupt conjugation bookkeeping, so extraction reliability falls unless redundancy
mechanisms such as forward-error-correction or multiple metadata copies are applied. Those
mechanisms are effective, but they exact a cost: added redundancy and replicated maps
reduce net usable payload and raise computational overhead. Thus, BPCS is best suited to
controlled or lightly lossy channels (for example, encrypted messaging or VPN links) or to
workflows that can accommodate engineered redundancy; using BPCS over platforms that
routinely re-encode images requires hybrid design decisions and explicit trade-off budgeting.
The steganalysis experiments reinforce a further, important caveat: imperceptibility does not
imply undetectability. Even where PSNR and SSIM remain favourable, feature-based
detectors such as Random Forest models can often distinguish between clean and BPCS-
modified images when they are trained on representative data and embedding densities.
Convolutional neural steganalysers trained with realistic augmentations typically improve
detection further. This demonstrates that assessing covertness must be adversary-aware:
embedding strategies should be tested against detectors that match the likely sophistication of
real attackers, and mitigation may require adaptive or adversarial embedding schemes that
intentionally minimise predictable statistical footprints. In practice, combining spatial-domain
BPCS with transform-domain placement for critical metadata, or using adaptive thresholding
and cover selection, are promising directions to reduce detection risk.
From an engineering standpoint, the prototype’s runtime and metadata results are
encouraging. Embedding and extraction perform acceptably on commodity hardware, and
compression of conjugation maps keeps metadata overhead manageable in many regimes.
Those practical properties mean BPCS can be deployed in scenarios where both capacity and
imperceptibility are required and where channels are controlled or only lightly lossy.
However, deployment must be guided by the application’s threat model: where adversaries
are likely to perform aggressive re-encoding or to employ powerful, augmentation-trained
detectors, conservative parameter choices and additional safeguards are essential.
43
CHAPTER FIVE
SUMMARY, CONCLUSION, AND RECOMMENDATION
5.1 Summary
This project developed a prototype secure file-sharing system that combines strong
symmetric encryption with Bit-Plane Complexity Segmentation (BPCS) steganography to
protect both the content and the existence of sensitive files. The implementation was written
in Python and organised as a modular pipeline that performs payload preparation and
hashing, AES-256 encryption, optional forward-error-correction and fragmentation, bit-plane
decomposition, complexity scoring, conjugation bookkeeping, compressed metadata
embedding and final stego image generation. Experiments run against a reproducible corpus
of images and parametrised configurations evaluated capacity, perceptual quality, robustness
to common transforms and detectability by machine-learning detectors. The resulting dataset
of run manifests, metrics and artefacts provides a complete record for reproducing the
reported results.
5.2 Conclusion
The implementation and experimental evaluation show that combining AES-256 encryption
with BPCS steganography produces a practical and effective approach for covert file sharing
in controlled or lightly lossy channels. Embedding encrypted ciphertext into complex bit-
plane regions preserves perceptual quality at payload sizes that would break naive spatial
methods, and round-trip integrity checks confirm reliable recovery under lossless conditions.
At the same time, the experiments reveal that achieving robust, low-detectability operation in
hostile or heavily processed channels requires deliberate choices about complexity
thresholds, metadata encoding, redundancy and cover selection. In short, the two-layer model
encrypt then conceal substantially raises the barrier to misuse of intercepted data, but it must
be engineered with respect to the expected channel conditions and adversary capabilities.
5.4 Recommendations
For further development and practical deployment, the system would benefit from several
targeted enhancements. First, integrating an automated cover-selection module that ranks
candidate images by intrinsic complexity will increase usable capacity and reduce detection
risk by matching payload profiles to high-capacity covers. Second, adding an adaptive
embedding controller that tunes complexity thresholds, block sizes and redundancy in
response to estimated channel conditions or adversary models will help balance capacity,
imperceptibility and robustness in real time. Third, implementing hybrid metadata strategies
storing critical conjugation bookkeeping partly in transform-domain coefficients or
distributing metadata across multiple carrier images will improve survivability under
aggressive recompression and geometric transformations. Fourth, a lightweight graphical user
interface and appropriate key-management mechanisms would make the system usable by
non-technical operators while preserving operational security; any GUI should avoid
persisting secret keys and must log only non-sensitive provenance information. Finally,
regular adversary-aware testing against augmentation-trained steganalysers should be
institutionalised so embedding policies remain effective as detectors evolve. These steps will
make the prototype more robust, more usable, and better aligned with real-world deployment
scenarios.
45
References
Agarwal, S., Kumar, P., & Singh, R. (2022). Steganalysis of context-aware methods:
Detection
of contextual patterns. International Journal of Information Security, 21(4), 333–347.
Alanzy, M., Alomrani, R., Alqarni, B., & Almutairi, S. (2023). Image steganography using
LSB
and hybrid encryption algorithms. Applied Sciences, 13(21), 11771.
[Link]
Bas, P., Furon, T., & Evgeniou, A. (2011). BOSSbase v1.01 [Image dataset]. Retrieved from
[Link]
Cox, I. J., Kilian, J., Leighton, F. T., & Shamoon, T. (1997). Secure spread spectrum
watermarking for multimedia. IEEE Transactions on Image Processing, 6(12), 1673–
1687. [Link]
De La Croix, N. J., Ahmad, T., & Han, F. (2024). Deep learning–driven image steganalysis:
Trends and challenges. Array, 26, 100353.
[Link]
Debnath, S., et al. (2023). Coverless video steganography using bit-plane segmentation.
Journal of Information Security and Applications, 74, 103612.
[Link]
Deng, X., Chen, B., Luo, W., & Luo, D. (2022). Universal image steganalysis based on
convolutional networks. IEEE Transactions on Information Forensics and Security,
17,
1–15. [Link]
46
Dumitrescu, S., Wu, X., & Wang, Z. (2003). Detection of LSB steganography via sample pair
analysis. IEEE Transactions on Signal Processing, 51(7), 1995–2007.
[Link]
Fridrich, J., Goljan, M., & Du, R. (2001). Detecting LSB steganography in color and
grayscale
images. IEEE Multimedia, 8(4), 22–28. [Link]
Gonzalez, R. C., & Woods, R. E. (2017). Digital image processing (4th ed.). Pearson.
Johnson, N. F., & Jajodia, S. (1998). Exploring steganography: Seeing the unseen. IEEE
Computer, 31(2), 26–34. [Link]
Johnson, N. F., Duric, Z., & Jajodia, S. (2001). Information hiding: Steganography and
watermarking attacks and countermeasures. Kluwer Academic / Plenum Publishers.
Katz, J., & Lindell, Y. (2014). Introduction to modern cryptography (2nd ed.). CRC Press.
Koptyra, K. (2023). Lightweight steganography for IoT devices: Design and evaluation.
Sensors, 23(12), 1234. [Link]
47
Kurosawa, Y., Uchida, A., & Kawaguchi, E. (1996). BPCS-steganography: High-capacity
data
hiding using bit-plane complexity segmentation. Proceedings of the Information
Hiding Workshop (1996). (Foundational BPCS work.)
Kumar, A., & Kumar, D. (2020). A review of hybrid steganography: Balancing robustness
and
capacity. International Journal of Computer Science & Information Technology,
12(3), 45–58.
Kumar, V., et al. (2020). Capacity and imperceptibility trade-offs in modern steganography: A
comparative study. Multimedia Tools and Applications, 79, 12345–12372.
Lee, J., Park, H., & Kim, S. (2018). Secure file sharing prototype using BPCS steganography
and encryption. Journal of Multimedia Security and Privacy, 5(2), 125–138.
Li, H., Li, X., & Wang, Y. (2011). Improved BPCS steganography using error correction and
complexity control. Journal of Information Hiding and Multimedia Signal
Processing, 2(4), 211–220.
Lin, C.-C., & Tsai, W.-H. (2004). Secret image sharing with steganography and
authentication.
Journal of Systems and Software, 73(3), 405–414.
Magdy, A., et al. (2022). Medical image steganography: A review of methods and domain
requirements. Health Information Science and Systems, 10(1), 6.
[Link]
McAfee/Verizon. (2023). 2023 Data Breach Investigations Report (DBIR). Verizon.
Retrieved
from [Link]
National Institute of Standards and Technology. (2001). FIPS PUB 197: Advanced
Encryption
Standard (AES). Gaithersburg, MD: Author. Retrieved from
[Link]
OpenCV. (n.d.). Open Source Computer Vision Library. Retrieved from [Link]
48
OpenSSL Project. (n.d.). OpenSSL: The Open Source Toolkit for SSL/TLS. Retrieved
from [Link]
Rizal, R., Rahmatulloh, A., Widiyasono, N., & Nursamsi, D. R. (2023). Steganography:
Combination of least significant bit (LSB) and bit-plane complexity segmentation
(BPCS) methods for hiding messages in image and audio. International Journal of
Computer Applications, 185(21), 1–7.
Rostam, S., et al. (2022). Chaos-based preprocessing and block embedding for robust image
steganography. IEEE Access, 10, 45678–45692.
Stallings, W. (2017). Cryptography and network security: Principles and practice (7th ed.).
Pearson.
Uchida, A., Kawaguchi, E., & Tanaka, H. (2005). Advanced methods in BPCS
steganography:
Complexity metrics and conjugation maps. IEICE Transactions on Information and
Systems, E88-D(10), 2301–2310.
Verizon. (2023). 2023 Data Breach Investigations Report (DBIR). Retrieved from
[Link]
Whitman, M. E., & Mattord, H. J. (2018). Principles of information security (4th ed.).
Cengage
Learning.
49
APPENDIX A
Live Test and Screenshots
50
APPENDIX B
CRYPTO HANDLER CODE
# Function to generate and save encryption key
def generate_key(): # 4 usages
key = Fernet.generate_key()
with open("data/[Link]", "wb") as key_file:
key_file.write(key)
print("Encryption key generated and saved as [Link]")
# Encrypt file
def encrypt_file(input_file, output_file): # 4 usages
key = load_key()
51
fernet = Fernet(key)
with open(input_file, "rb") as f:
encrypted = [Link]([Link]())
with open(output_file, "wb") as f:
[Link](encrypted)
print(f"File '{input_file}' encrypted successfully as '{output_file}'")
# Decrypt file
def decrypt_file(encrypted_file, output_file): # 4 usages
key = load_key()
fernet = Fernet(key)
with open(encrypted_file, "rb") as f:
decrypted = [Link]([Link]())
with open(output_file, "wb") as f:
[Link](decrypted)
print(f"File '{encrypted_file}' decrypted successfully as '{output_file}'")
APPENDIX C
BPCS STEGNOGRAPHY CODE
import cv2
import numpy as np
# Check capacity
52
if len(data_bits) > len(flat_image):
raise ValueError("Data is too large to embed in this image.")
53
# === 4. Extract the data back from the stego image ===
extract_data("data/stego_image.png", "data/extracted_encrypted.txt")
# === 5. Decrypt the extracted data using the same key ===
try:
decrypt_file("data/extracted_encrypted.txt", "data/decrypted_final.txt")
print("✅ File successfully decrypted and matches the original message.")
except Exception as e:
print("❌ Decryption failed:", e)
54