Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23291

Windows: Random Values while trying to decrypt value using AES encryption on device

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 5.2.0
    • Fix Version/s: Release 7.0.0
    • Component/s: Windows
    • Environment:

      SDK 5.2.0.GA
      OS : Windows phone 8.1
      Device : Microsoft Lumia 435

    • Story Points:
      8
    • Sprint:
      2017 Sprint 21 SDK

      Description

      I am trying to implement encryption in my app for Windows Phone 8.1, it successfully encrypts the value but when I try to decrypt the same value it is generating random values every time.

      Below is the code I am using for encryption and decryption.

       
      var CryptoJS = require('aes').CryptoJS;
       
       
      function encrypt(input) {
      	var encrypted = CryptoJS.AES.encrypt(input, "12345");
      	return encrypted;
      }
       
       
      function decrypt(input) {
      	var decrypted = CryptoJS.AES.decrypt(input, "12345").toString(CryptoJS.enc.Utf8);
      	return decrypted;
      }
       
      var devId = Ti.Platform.id;
      alert("DevID : "+devId);
      var encr = encrypt(devId);
      alert("encr : "+encr);
       
      alert("decr : "+decrypt(encr));
       
      
      

      P.S : When I run this app on emulator it is correctly decrypting the vales but when I try same app on device I am facing the above stated problem.

        Attachments

          Activity

            People

            • Assignee:
              kiguchi Kota Iguchi
              Reporter:
              paramsb Parmeet Singh
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-9691
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code