Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71591

calling imported JS function slows down by 20x

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.0 RC
    • 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
    • Android, iOS/tvOS/watchOS, macOS
    • 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:

      https://github.com/ekke/encrypt_text

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            laknoll Lars Knoll
            ekkescorner Ekkehard
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes