4
0
mirror of https://github.com/QuasarApp/Qt-AES.git synced 2025-05-03 08:49:35 +00:00

added padding stuff

This commit is contained in:
Matteo Brichese 2018-03-28 17:50:41 -07:00
parent f94a6339de
commit 56c2554df5

@ -28,7 +28,12 @@ QAESEncryption::ExpandKey => expandKey(...)
```
#### Padding
Please note that as of today all input that does not comes as a muptiple of 16 will be padded with zeros to the closest multiple value.
By default the padding method is `ISO`, however, the class supports:
```
ZERO
PKCS7
ISO
```
### Example
Sample code using a 128bit key in ECB mode
@ -59,6 +64,10 @@ Example for 256bit CBC using QString
QByteArray encodeText = encryption.encode(inputStr.toLocal8Bit(), hashKey, hashIV);
QByteArray decodeText = encryption.decode(encodeText, hashKey, hashIV);
QString decodedString = QString(QAESEncryption::RemovePadding(decodeText));
//decodedString == inputStr !!
```
### Example via static invocation