k.elgohary
k.elgohary

Reputation: 443

QML Password encryption

I am developping an application by QML on nokia mobile phone which deal with a server.

I need to send an encrypted password "using DES encryption algorithm " to the server side.

how can I do this?

I have been used http://www.tero.co.uk/des/ as follow :

  import "../js/Des.js" as Core

  Button {
  id:loginBtn
  anchors.centerIn: parent
  text: "test encryption"
 onClicked: {
  var doc = new XMLHttpRequest();
  doc.onreadystatechange = function() {


                        if(doc.readyState == XMLHttpRequest.DONE) {
                                    var a = doc.responseText;
                                    print(a);

                  }


        }
  var result = Core.des ("My_key","1234");
     print(result);
  }
  }

the result variable valus is : A????r4

can anyone tell me if i used that library wrong or tell me another solution .

Thanks in advance ..

Upvotes: 0

Views: 946

Answers (1)

onion
onion

Reputation: 437

Two solutions:

Do the DES encryption directly in QML using Javascript, a quick google gave this page http://www.tero.co.uk/des/

Or you create a small wrapper in C++ that you call from javascript to do the DES encryption. There are plenty of libraries available, for example http://delta.affinix.com/qca/

Upvotes: 1

Related Questions