[Qt-interest] QCA big string encryption
Yuvraaj Kelkar
yuvraaj at gmail.com
Sun Apr 24 20:42:31 CEST 2011
Some mistakes I've made with any security API:
1. Is the key length long enough for the algorithm? eg. Blowfish needs
an 8 byte key, AES needs a 16 byte key. When I didn't use 16 bytes for
AES, I got weird results on decryption.
2. Is there a "final" block function? This needs to be called even if
you have nothing left to add.
3. Is the IV initialized to an appropriate length?
4. Does the API take care of the padding of the end block or do I have
to do that - meaning is it stream or block based?
HTH
Uv
On Sun, Apr 24, 2011 at 11:31 AM, Jason H <scorp1us at yahoo.com> wrote:
> It's beena while since I used QCA, but do you need to finalize() it for the
> last block?
>
>
>
>
> ----- Original Message ----
> From: Nicholas Shatokhin <n.shatokhin at gmail.com>
> To: qt-interest at qt.nokia.com
> Sent: Sun, April 24, 2011 1:12:41 PM
> Subject: [Qt-interest] QCA big string encryption
>
> Hello.
>
> I'm trying to encrypt end decrypt long string. But after decryption, I get
> only part of string. What's wrong?
>
> Code:
>
> QCA::SecureArray arg = data;
> qDebug() << arg.toByteArray();
> QCA::SecureArray result = publicKey.encrypt(arg, QCA::EME_PKCS1_OAEP);
> privateKey.decrypt(result, &arg, QCA::EME_PKCS1_OAEP);
> qDebug() << arg.toByteArray();
>
> Output:
>
> "{"method": 1, "data": {"email": "dfgh", "usePassword": "false",
> "password": "", "useFingerprint": false, "fingerprint": "", "publicKey":
> "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlHZk1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTkFEQ0JpUUtCZ1FDN05UNjd6R1pHajZpbDc5K3ErOWo5K2s5cApnVHJJOGxRVlFoQkxuVWxBNFArS01selBEOU9aOEk0UXRWNEdjT0ZOYWFyTjByZFlacllKaVF2VjBUQkdSSnRWCnNEOTVsZzNPMHFzVHBuSVdrYW5rUTVFUmdiTDlqQ0grb0taNFBrUEd0OW9MVjhCOGphNjFRazdhLytBVUZ1UUQKeDBMUGZvUyt5VkVoYXNjM0x3SURBUUFCCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo="}
>
> }"
>
> "{"method": 1, "data": {"email": "dfgh", "usePassword": "false",
> "password": "", "useFi"
>
>
> Best regards,
> Nick.
>
> --
> За використання революційного клієнта електронної пошти Opera:
> http://www.opera.com/mail/
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list