ekke
2018-11-05 11:00:58 UTC
Qt 5.12 Beta 3. Android and iOS
in one of my apps I had to encrypt the user password using a JavaScript
library
http://www-cs-students.stanford.edu/%7Etjw/jsbn/
from there I put these .js into resources:
<RCC>
<qresource prefix="/">
<file>js/rsbn/base64.js</file>
<file>js/rsbn/jsbn.js</file>
<file>js/rsbn/prng4.js</file>
<file>js/rsbn/rng.js</file>
<file>js/rsbn/rsa.js</file>
</qresource>
</RCC>
in QML:
import "../../js/rsbn/jsbn.js" as MyJsbn
import "../../js/rsbn/rsa.js" as MyRsa
import "../../js/rsbn/rng.js" as MyRng
import "../../js/rsbn/prng4.js" as MyPrng4
import "../../js/rsbn/base64.js" as MyBase64
function doEncrypt() {
var rsa = new MyRsa.RSAKey();
rsa.setPublic(dataServer.modulusHex(), "10001")
console.log("5.12 OK")
var res = rsa.encrypt(pwText.text)
console.log("5.12 freeze")
if(res) {
return MyRsa.linebrk(res, 64)
} else {
return ""
}
}
in 5.10.1 or 5.11.2 this is working fine
in 5.12 Beta 3 it freezes as soon as calling rsa.encrypt()
any idea what could be different in 5.12 ?
thx
ekke
in one of my apps I had to encrypt the user password using a JavaScript
library
http://www-cs-students.stanford.edu/%7Etjw/jsbn/
from there I put these .js into resources:
<RCC>
<qresource prefix="/">
<file>js/rsbn/base64.js</file>
<file>js/rsbn/jsbn.js</file>
<file>js/rsbn/prng4.js</file>
<file>js/rsbn/rng.js</file>
<file>js/rsbn/rsa.js</file>
</qresource>
</RCC>
in QML:
import "../../js/rsbn/jsbn.js" as MyJsbn
import "../../js/rsbn/rsa.js" as MyRsa
import "../../js/rsbn/rng.js" as MyRng
import "../../js/rsbn/prng4.js" as MyPrng4
import "../../js/rsbn/base64.js" as MyBase64
function doEncrypt() {
var rsa = new MyRsa.RSAKey();
rsa.setPublic(dataServer.modulusHex(), "10001")
console.log("5.12 OK")
var res = rsa.encrypt(pwText.text)
console.log("5.12 freeze")
if(res) {
return MyRsa.linebrk(res, 64)
} else {
return ""
}
}
in 5.10.1 or 5.11.2 this is working fine
in 5.12 Beta 3 it freezes as soon as calling rsa.encrypt()
any idea what could be different in 5.12 ?
thx
ekke