PxCrypt v0.1
Encrypt data within an image
Loading...
Searching...
No Matches
encdec.h
1#ifndef ENCDEC_P_H
2#define ENCDEC_P_H
3
4// Qt Includes
5#include <QString>
6#include <QCryptographicHash>
7#include <QSize>
8#include <QImage>
9
10using namespace Qt::Literals::StringLiterals;
11
12namespace PxCrypt
13{
16//-Namespace Enums-------------------------------------------------------------------------------------------------
17enum Channel : quint8{
18 Red = 0,
19 Green = 1,
20 Blue = 2,
21 Alpha = 3
22};
23
24// These are essentially the same as Encoder::Encoding, but exist to keep the usage of that enum strictly within
25// the public API so that encoder.h is not a required include in private parts of the code base.
26enum EncStrat
27{
28 Displaced = 0,
29 Direct = 4
30};
31
32//-Namespace Variables-------------------------------------------------------------------------------------------------
33const QByteArray MAGIC_NUM = "PXC"_ba;
34
35const int META_PIXELS = 2; // BPC + EncType
36
37const int MAGIC_SIZE = MAGIC_NUM.size();
38const int CHECKSUM_SIZE = sizeof(quint32);
39const int TAG_LENGTH_SIZE = sizeof(quint16);
40const int PAYLOAD_LENGTH_SIZE = sizeof(quint32);
41const int HEADER_BYTES = MAGIC_SIZE +
42 CHECKSUM_SIZE +
43 TAG_LENGTH_SIZE +
44 PAYLOAD_LENGTH_SIZE;
45
46static inline const QByteArray DEFAULT_SEED = "The best and most secure seed that is possible to exist!"_ba;
47
48//-Namespace Functions-------------------------------------------------------------------------------------------------
49quint64 calcMaxPayloadBits(const QSize& dim, quint16 tagSize, quint8 bpc);
50quint64 calcMaxPayloadBytes(const QSize& dim, quint16 tagSize, quint8 bpc);
51QImage standardizeImage(const QImage& img);
52
54}
55
56
57#endif // ENCDEC_P_H
The PxCrypt namespace is the main namespace through which all functionality of the PxCrypt library is...
Definition decode_error.cpp:5
qsizetype size() const const