Update README.md

This commit is contained in:
Matteo Brichese 2017-07-03 11:08:18 -07:00 committed by GitHub
parent 093f524e98
commit dd17d8715b

View File

@ -3,4 +3,15 @@ AES Encryption in Qt.
Porting of the Tiny-AES-C
## Usage
To Do
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.