diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2014-10-06 15:03:54 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2014-10-06 15:03:54 +0200 |
| commit | 529f38bd8878b6b1bea2b5457031ce936aab8d80 (patch) | |
| tree | 1193caefcad12f6a36f818048e4547e60add4398 /libcommuni/src/3rdparty/qblowfish/README.md | |
| parent | 3b58b5536935adff242928ed9f30e1c0262fbd7c (diff) | |
| download | manager-529f38bd8878b6b1bea2b5457031ce936aab8d80.tar.gz manager-529f38bd8878b6b1bea2b5457031ce936aab8d80.zip | |
addedd communi
Diffstat (limited to 'libcommuni/src/3rdparty/qblowfish/README.md')
| -rw-r--r-- | libcommuni/src/3rdparty/qblowfish/README.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libcommuni/src/3rdparty/qblowfish/README.md b/libcommuni/src/3rdparty/qblowfish/README.md new file mode 100644 index 0000000..fb961bb --- /dev/null +++ b/libcommuni/src/3rdparty/qblowfish/README.md @@ -0,0 +1,28 @@ +# QBlowfish + +QBlowfish is a [Qt](http://qt.nokia.com/) implementation of the [Blowfish](http://www.schneier.com/blowfish.html) encryption algorithm, as described in the original Blowfish [paper](http://www.schneier.com/paper-blowfish-fse.html) by Bruce Schneier. + +The Blowfish algorithm requires the input in 8-byte blocks. To simplify usage, QBlowfish can optionally add [PKCS5 padding](http://tools.ietf.org/html/rfc5652#section-6.3) to the input data. (For example, if the input is only 60 bytes long, 4 bytes will be padded to bring the bytecount to a multiple of 8.) When padding is enabled during decryption, QBlowfish will also remove the padded bytes from the output. + +You only need to add 3 files (src/*) to your project. You can then use the QBlowfish class to encrypt and decrypt stuff. + + QByteArray secretKey("This is a secret") + QString clearText("Stuff to encrypt"); + + QBlowfish bf(secretKey); + bf.setPaddingEnabled(true); + QByteArray encryptedBa = bf.encrypted(clearText.toUtf8()); + +A more detailed example is included in the repo. + +QBlowfish is not optimized for speed. It processes the data in bytes (most other Blowfish implementations seem to work on 4-byte words) and is endianness-agnostic. + +### Tests + +Unit tests are written using QTestLib. Tests include [the official test vectors](http://www.schneier.com/code/vectors.txt). + +QBlowfish has been tested with Qt 4.8 on Windows and Linux. + +### License + +QBlowfish is published under the MIT license. |
