91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 237KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-14
  • 語言: C/C++
  • 標簽:

資源簡介

本項目使用CLion軟件編寫,使用語言為C++。
項目實現JPEG(JPG)格式圖片中隱藏信息及隱藏信息的提取功能,支持中文信息隱藏。
注釋完備,操作簡單!

資源截圖

代碼片段和文件信息

#include
#include

using?namespace?std;

class?picture?{
private:
????ifstream?ifile_picture;//該數據類型表示輸入文件流,用于從文件讀取信息。
????ifstream?ifile_txt;
????ofstream?ofile_picture;//該數據類型表示輸出文件流,用于創建文件并向文件寫入信息。
????ofstream?ofile_txt;
????int?length_ifile_picture?length_ifile_txt;//輸入圖片的長度
????char?name_ifile_picture[50]?name_ifile_txt[50]?name_ofile_picture[50]?name_ofile_txt[50];
public:
????void?Open(ifstream?&ifile?char?*name?int?&length);

????void?Encode();//圖片信息隱藏
????void?Decode();//圖片信息提取
};

void?picture::Open(ifstream?&ifile?char?*name?int?&length)?{
????ifile.open(name?ios::binary?|?ios::in);//ios::in表示打開文件用于讀取。
????if?(!ifile)?{
????????cout?<????????return;
????}
????ifile.seekg(0?ios::end);//表示輸入流的結束位置
????length?=?ifile.tellg();//返回當前定位指針的位置,也代表著輸入流的大小。
????ifile.seekg(0?ios::beg);//表示輸入流的開始位置
}

void?picture::Encode()?{
????char?*str;
????//請輸入想要寫入隱藏信息的圖片的完整路徑及名稱,后綴為“.jpg“
????cout?<????cin?>>?this->name_ifile_picture;//獲取輸入圖片文件名稱
????Open(this->ifile_picture?this->name_ifile_picture?this->length_ifile_picture);
????str?=?new?char[length_ifile_picture?+?5];
????this->ifile_picture.read(str?this->length_ifile_picture);
????while?(1)?{
????????if?(str[this->length_ifile_picture?-?2]?==?-1?&&?str[this->length_ifile_picture?-?1]?==?-39)
????????????break;???//判斷是否到達圖像結束標志??FF?D9
????????else
????????????this->length_ifile_picture--;
????}
????//請輸入成功寫入隱藏信息后生成的新圖片的完整保存路徑及名稱,后綴為“.jpg“
????cout?<????cin?>>?this->name_ofile_picture;
????this->ofile_picture.open(this->name_ofile_picture?ios::binary?|?ios::out);
????if?(!this->ofile_picture)?{
????????cout?<name_ofile_picture?<????????return;
????}
????this->ofile_picture.write(str?this->length_ifile_picture);
????this->ifile_picture.close();
????delete[]str;
????//輸入帶有隱藏信息的文本的完整路徑及名稱,后綴為“.txt“
????cout?<????cin?>>?this->name_ifile_txt;
????Open(this->ifile_txt?this->name_ifile_txt?this->length_ifile_txt);
????str?=?new?char[length_ifile_txt?+?5];
????this->ifile_txt.read(str?this->length_ifile_txt);
????this->ofile_picture.write(str?this->length_ifile_txt);
????this->ifile_txt.close();
????this->ofile_picture.close();
????delete[]str;
????cout?<}

void?picture::Decode()????????//信息提取
{
????char?*str;
????//請輸入帶有隱藏信息的圖片的完整保存路徑及名稱,后綴為“.jpg“
????cout?<????cin?>>?this->name_ifile_picture;//獲取輸入圖片文件名稱
????Open(this->ifile_picture?this->name_ifile_picture?this->length_ifile_picture);
????str?=?new?char[length_ifile_picture?+?5];
????this->ifile_picture.read(str?this->length_ifile_picture);
????int?l?=?this->length_ifile_picture;
????while?(1)?{
????????if?(str[l?-?2]?==?-1?&&?str[l?-?1]?==?-39)
????????????break;???//圖像結束標志??FF?D9
????????else
????????????l--;
????}
????//輸入提取信息后信息的保存文本的完整路徑及名稱,后綴為“.txt“
????cout?<

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-11-12?09:53??JEPG_Project\
?????目錄???????????0??2019-11-12?09:37??JEPG_Project\cmake-build-debug\
?????文件?????????125??2019-11-12?09:12??JEPG_Project\CMakeLists.txt
?????文件????????6148??2019-11-12?09:53??JEPG_Project\.DS_Store
?????文件?????????120??2019-11-12?09:53??__MACOSX\JEPG_Project\._.DS_Store
?????文件????????4623??2019-11-12?09:53??JEPG_Project\main.cpp
?????目錄???????????0??2019-11-12?09:53??JEPG_Project\.idea\
?????文件????????6148??2019-11-12?09:25??JEPG_Project\cmake-build-debug\.DS_Store
?????文件?????????120??2019-11-12?09:25??__MACOSX\JEPG_Project\cmake-build-debug\._.DS_Store
?????目錄???????????0??2019-11-12?09:37??JEPG_Project\cmake-build-debug\CMakeFiles\
?????文件????????5173??2019-11-12?09:26??JEPG_Project\cmake-build-debug\Makefile
?????文件????????5952??2019-11-12?09:26??JEPG_Project\cmake-build-debug\JEPG_Project.cbp
?????文件????????1432??2019-11-12?09:26??JEPG_Project\cmake-build-debug\cmake_install.cmake
?????文件??????????29??2019-11-12?09:30??JEPG_Project\cmake-build-debug\hidden_mesg.txt
?????文件???????81220??2019-11-12?09:28??JEPG_Project\cmake-build-debug\JEPG_Project
?????文件???????42433??2019-11-12?09:26??JEPG_Project\cmake-build-debug\CMakeCache.txt
?????文件???????93682??2018-12-25?08:58??JEPG_Project\cmake-build-debug\source.jpg
?????文件???????27812??2019-10-07?06:24??JEPG_Project\cmake-build-debug\dlam.jpg
?????文件?????????233??2019-10-07?06:24??__MACOSX\JEPG_Project\cmake-build-debug\._dlam.jpg
?????文件????????4524??2019-11-12?09:53??JEPG_Project\.idea\workspace.xml
?????文件?????????276??2019-11-12?09:12??JEPG_Project\.idea\modules.xml
?????文件??????????97??2019-11-12?09:12??JEPG_Project\.idea\JEPG_Project.iml
?????文件?????????240??2019-11-12?09:12??JEPG_Project\.idea\misc.xml
?????文件??????????85??2019-11-12?09:26??JEPG_Project\cmake-build-debug\CMakeFiles\cmake.check_cache
?????目錄???????????0??2019-11-12?09:26??JEPG_Project\cmake-build-debug\CMakeFiles\3.15.3\
?????文件???????28430??2019-11-12?09:26??JEPG_Project\cmake-build-debug\CMakeFiles\CMakeOutput.log
?????目錄???????????0??2019-11-12?09:28??JEPG_Project\cmake-build-debug\CMakeFiles\JEPG_Project.dir\
?????文件???????11134??2019-11-12?09:26??JEPG_Project\cmake-build-debug\CMakeFiles\Makefile.cmake
?????目錄???????????0??2019-11-12?09:26??JEPG_Project\cmake-build-debug\CMakeFiles\CMakeTmp\
?????文件???????????2??2019-11-12?09:26??JEPG_Project\cmake-build-debug\CMakeFiles\progress.marks
?????文件?????????293??2019-11-12?09:26??JEPG_Project\cmake-build-debug\CMakeFiles\TargetDirectories.txt
............此處省略27個文件信息

評論

共有 條評論