Steganography
A C++ Steganography tool which leverages the LSB and DCT embedding techniques
least_significant_bit.hpp
1 /* This file is a part of "Steganography" a C++ steganography tool.
2 
3 Copyright (C) 2019 James Lee <jamesl33info@gmail.com>.
4 
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 
18 #include <iostream>
19 #include <string>
20 #include <thread>
21 #include <vector>
22 #include <boost/filesystem.hpp>
23 #include <opencv2/core/core.hpp>
24 #include <opencv2/highgui/highgui.hpp>
25 #include "steganography.hpp"
26 #include "exceptions.hpp"
27 
28 #ifndef LEAST_SIGNIFICANT_BIT_HPP
29 #define LEAST_SIGNIFICANT_BIT_HPP
30 
32 {
33  public:
39  LeastSignificantBit(const boost::filesystem::path &image_path) : Steganography(image_path)
40  {
41  this->image_capacity = (this->image.rows * this->image.cols * this->image.channels()) - 64;
42  }
43 
51  void Encode(const boost::filesystem::path &);
52 
57  void Decode();
58 
59  private:
65 
76  void EncodeChunk(const int &start, std::vector<unsigned char>::iterator it, std::vector<unsigned char>::iterator en);
77 
85  void EncodeChunkLength(const int &start, const unsigned int &chunk_length);
86 
95  void DecodeChunk(const int start, std::vector<unsigned char>::iterator it, std::vector<unsigned char>::iterator en);
96 
105  unsigned int DecodeChunkLength(const int &start);
106 };
107 
108 #endif // LEAST_SIGNIFICANT_BIT_HPP
boost::filesystem::path image_path
Definition: steganography.hpp:75
void EncodeChunkLength(const int &start, const unsigned int &chunk_length)
Definition: least_significant_bit.cpp:170
void EncodeChunk(const int &start, std::vector< unsigned char >::iterator it, std::vector< unsigned char >::iterator en)
Definition: least_significant_bit.cpp:140
int image_capacity
Definition: least_significant_bit.hpp:64
unsigned int DecodeChunkLength(const int &start)
Definition: least_significant_bit.cpp:232
void Encode(const boost::filesystem::path &)
Definition: least_significant_bit.cpp:22
Definition: steganography.hpp:32
void DecodeChunk(const int start, std::vector< unsigned char >::iterator it, std::vector< unsigned char >::iterator en)
Definition: least_significant_bit.cpp:200
void Decode()
Definition: least_significant_bit.cpp:86
LeastSignificantBit(const boost::filesystem::path &image_path)
Definition: least_significant_bit.hpp:39
Definition: least_significant_bit.hpp:31
cv::Mat image
Definition: steganography.hpp:81