PictureCrypt  1.4.1
An image-steganography project
PictureCrypt

Project made using QT Creator in C++

About

A simple cross-platform steganography project which hides data in images. This project was built using amazing Qt Framework and QAESEncryption by bricke. You can read more about project at the home page

Structure of the project

MVC pattern used. Here is a simple project scheme, showing main classes.

dot_structure.png

External use

You can use ModelPC class separately from View and Control layer. You will need just the src/app/model folder, so these four files:

Then you can just #include "modelpc.h" and use API.

API

Here is are the most important methods:

Showcase

// Includes
#include "modelpc.h"
#include <QImage>
#include <QByteArray>
#include <QString>
#include <QDebug> // just for showcase
...
// Basic setup
QByteArray data("some_file.txt");
QImage *image = new QImage("some_big_enough_image.jpg");
QString key = "some_password";
int bitsUsed = 3; // must be from 1 to 8
// Encrypting
QString error1, error2;
QImage *normal_resultImage = ModelPC::Encrypt(
data,
image,
1, // normal mode
key,
bitsUsed,
&error1);
QImage *advanced_resultImage = ModelPC::Encrypt(
data,
image,
2, // advanced mode
key,
bitsUsed, // not really used here, so put here any number from 1 to 8
&error2);
// Decrypting with given mode
QString error3, error4, error5, error6;
QByteArray output_normal = ModelPC::Decrypt(
normal_resultImage,
key,
1, // normal
&error3);
QByteArray output_advanced = ModelPC::Decrypt(
advanced_resultImage,
key,
2, // advanced
&error4);
// Decrypting without given mode
// PictureCrypt can detect the mode of the image and adapt.
QByteArray output_normal_undefined = ModelPC::Decrypt(
normal_resultImage,
key,
0, // auto-detect mode
&error5);
QByteArray output_advanced_undefined = ModelPC::Decrypt(
advanced_resultImage,
key,
0, // auto-detect mode
&error6);
// Check (better testing with running tests [See section 'Run tests'])
bool data_good =
data == output_normal &&
data == output_advanced &&
data == output_normal_undefined &&
data == output_advanced_undefined;
bool no_errors =
error1 == "ok" &&
error2 == "ok" &&
error3 == "ok" &&
error4 == "ok" &&
error5 == "ok" &&
error6 == "ok";
if(data_good && no_errors)
qDebug() << "PASS";
else
qDebug() << "FAIL";

License

This software is provided under the MIT License

Contact us

Visit my site: https://www.alexkovrigin.me

Email me at a.kov[email protected]rigi[email protected][email protected][email protected]ail.[email protected]com

Author
Alexander Kovrigin (waleko)