Qt-AES/README.md

19 lines
611 B
Markdown
Raw Normal View History

2017-06-06 17:15:23 -07:00
# Qt-AES
2017-07-06 13:49:28 -07:00
Small and portable AES encryption class for Qt.
2017-07-06 13:48:26 -07:00
Supports all key sizes - 128/192/256 and ECB/CBC modes
2017-06-23 14:43:59 -07:00
## Usage
2017-07-03 11:08:18 -07:00
Import the header file
```#include "qaesencryption.h"
...
QAESEncryption encryption(QAESEncryption::AES_128, QAESEncryption::ECB);
QByteArray encodedHex = encryption.encode(hexText, keyHex);
QByteArray decodedHex = encryption.decode(hexText, keyHex);
```
## Tips
In AES the key needs to be 128/192/256 bits long, an MD5 Hash can be used to generate a 128 bit long QByteArray from a QString, a SHA256 can be used to generate a 256bit key.
2017-07-06 13:48:26 -07:00
See the *main.cpp* file for references on usage