Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.0 Beta 3
-
None
-
Qt 5.12 Beta 3 (compared with Qt 5.11.2)
Android, iOS, macOS
on macOS 10.13.6
-
-
ae6f850ab50bfe07625df4f810c7bf975c224877 (qt/qtdeclarative/5.12.0)
Description
use-case: only if user password changes (one time a month) I must RSA encrypt this password and send base64 to server.
must work on Android and iOS and I couldn't figure out HowTo do this from C++.
because it's not in daily use I was looking for a JS library from http://www-cs-students.stanford.edu/~tjw/jsbn/
Implemenation was easy: add .js to resource, import into QML, then call this function:
function doEncrypt() { var rsa = new MyRsa.RSAKey(); rsa.setPublic(dataServer.modulusHex(), "10001") var res = rsa.encrypt(pwText.text) if(res) { return MyRsa.linebrk(res, 64) } else { return "" } }
this works well for 5.9.x, 5.10.x, 5.11.x but slows down by 20x on Qt 5.12 Beta 3 from 5.11.2
- macOS: from 5 ms to 1211 ms
- Android: from 466 ms to 7403 ms
- iOS: from 77 ms to 1680 ms
I prepared a very simple to use test project, so you can test easy: