{ "id": "159500", "key": "TIMOB-23291", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-10-19T07:15:52.000+0000", "created": "2016-04-12T15:17:16.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "8.1", "AES", "alloy", "decryption", "encryption" ], "versions": [ { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "issuelinks": [], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:49:25.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "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.\r\n\r\nBelow is the code I am using for encryption and decryption.\r\n\r\n\r\n{code:java}\r\n\r\nvar CryptoJS = require('aes').CryptoJS;\r\n\r\n\r\nfunction encrypt(input) {\r\n\tvar encrypted = CryptoJS.AES.encrypt(input, \"12345\");\r\n\treturn encrypted;\r\n}\r\n\r\n\r\nfunction decrypt(input) {\r\n\tvar decrypted = CryptoJS.AES.decrypt(input, \"12345\").toString(CryptoJS.enc.Utf8);\r\n\treturn decrypted;\r\n}\r\n\r\nvar devId = Ti.Platform.id;\r\nalert(\"DevID : \"+devId);\r\nvar encr = encrypt(devId);\r\nalert(\"encr : \"+encr);\r\n\r\nalert(\"decr : \"+decrypt(encr));\r\n\r\n\r\n{code}\r\n\r\nP.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.", "attachment": [], "flagged": false, "summary": "Windows: Random Values while trying to decrypt value using AES encryption on device", "creator": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 5.2.0.GA\r\n OS : Windows phone 8.1\r\n Device : Microsoft Lumia 435", "closedSprints": [ { "id": 959, "state": "closed", "name": "2017 Sprint 21 SDK", "startDate": "2017-10-08T20:38:15.130Z", "endDate": "2017-10-22T20:38:00.000Z", "completeDate": "2017-10-24T23:55:56.605Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "382568", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nThanks for sharing the issue with us. It will be helpful for us to identify the problem if you share the source of the 'aes' module that you are using. \r\nRegards\r\n", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-13T06:47:45.000+0000", "updated": "2016-04-13T06:47:45.000+0000" }, { "id": "382574", "author": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Nazmus,\r\n\r\nI have used below links for AES : \r\n\r\nhttp://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/core-min.js\r\nhttp://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-utf16-min.js\r\nhttp://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js\r\n\r\nP.S : We have used same AES method for iOS and Android and its working fine on them even it works well with windows phone emulator.", "updateAuthor": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-13T08:13:43.000+0000", "updated": "2016-04-14T12:53:43.000+0000" }, { "id": "382894", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~paramsb],\r\n\r\nI guess you have made your own module from those file and accessed that as follows.\r\n{code}\r\nvar CryptoJS = require('aes').CryptoJS;\r\n{code}\r\n\r\nPlease give us your code of the module so that we can test your code and find the actual reason for this inconvenience. \r\n\r\nThanks in advance", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-17T08:45:15.000+0000", "updated": "2016-04-17T08:45:15.000+0000" }, { "id": "383473", "author": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Dear Nazmus Salahin,\r\n\r\nThanks for responding.\r\nI am not creating any module, I have just created a new file under lib folder as 'AES' and have used the codes from the above listed libs and then I am calling the lib and using the encrypt & decrypt function.", "updateAuthor": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-21T07:05:58.000+0000", "updated": "2016-04-21T07:05:58.000+0000" }, { "id": "383501", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nPlease share that file with us.\r\n\r\nThanks in advance", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-21T09:09:55.000+0000", "updated": "2016-04-21T09:09:55.000+0000" }, { "id": "383538", "author": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello Nazmus,\r\nWe have already shared the file link.\r\nSince Appcelerator does not have AES Module, we have used google AES library and required those file.\r\n\r\nUnder lib folder we have included below files : \r\nhttp://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/core-min.js\r\nhttp://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-utf16-min.js\r\nhttp://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js\r\n\r\nAt index page we are requiring :\r\n\r\nvar CryptoJS = require('aes').CryptoJS;\r\n\r\nAnd we are using it in below function : \r\n \r\nfunction encrypt(input) {\r\n \r\n\tvar encrypted = CryptoJS.AES.encrypt(input, \"12345\");\r\n \r\n\treturn encrypted;\r\n \r\n}\r\n \r\n \r\nfunction decrypt(input) {\r\n \r\n\tvar decrypted = CryptoJS.AES.decrypt(input, \"12345\").toString(CryptoJS.enc.Utf8);\r\n \r\n\treturn decrypted;\r\n \r\n}", "updateAuthor": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-21T14:23:35.000+0000", "updated": "2016-04-21T14:23:35.000+0000" }, { "id": "383765", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~paramsb],\r\nI am not able to reproduce this issue with your given step. If you can provide us with reproducible test code and test step it will be possible for us to test the issue. \r\nThanks\r\n", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-25T06:01:46.000+0000", "updated": "2016-04-25T06:01:46.000+0000" }, { "id": "384030", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nI am able to reproduce this issue. Encryption and decryption works fine on emulator but not on real device.\r\n\r\n*Steps:*\r\n1. Download the project from [Google Drive|https://drive.google.com/open?id=0B_1-iP4yRzEsODV4SUxGWHp0Yjg]\r\n2. Import the project.\r\n3. Build and run the app on Windows Phone real device >> Random value is generated after each decryption as seen in alerts.\r\n4. Build and run the app on Windows Phone emulator >> Correct value is produced after decryption.\r\n\r\n \r\nThanks\r\n\r\n\r\n*Environment*:\r\n\r\n*Device info:* Windows Phone Emulator and Microsoft Lumia 640 (Windows Phone 8.1)\r\n*Node.js Version:* 0.12.7\r\n*npm Version:* 2.11.3\r\n*Titanium SDKs:* 5.2.2.GA and 5.2.1.GA\r\n*Java Development Kit Version:* 1.8.0_73\r\n*Titanium CLI Version:* 5.0.5\r\n*Appcelerator CLI Version:* 5.2.2\r\n*Appcelerator Studio:* 4.5.0\r\n", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-27T05:24:52.000+0000", "updated": "2016-04-27T05:24:52.000+0000" }, { "id": "384969", "author": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello Nazmus,\r\n\r\nJust want to know when can I expect the bug to be resolved as I am waiting to implement it and publish.\r\n\r\nThanks", "updateAuthor": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-06T06:41:21.000+0000", "updated": "2016-05-06T06:41:21.000+0000" }, { "id": "385102", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I have started looking into this recently. I was able to reproduce this on my device too, this ticket is scheduled to 5.4.0 release and I hope we can resolve this until then...", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-05-09T04:53:34.000+0000", "updated": "2016-05-09T04:53:34.000+0000" }, { "id": "385215", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I think we hit a bug in JavaScript engine (JavaScriptCore) that we are using. I saw several people reported CryptoJS doesn't work on Safari and Chrome. Is there any way to workaround this?\r\n\r\nhttps://github.com/Runscope/crypto-js/issues/80\r\nhttps://code.google.com/archive/p/crypto-js/issues/72\r\nhttps://bugs.chromium.org/p/chromium/issues/detail?id=173907\r\n", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-05-10T01:55:16.000+0000", "updated": "2016-05-10T01:55:16.000+0000" }, { "id": "386034", "author": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Nazmus, Kota,\r\n\r\nThanks for your efforts.\r\nkindly update us on when we can expect the bug to be resolved.\r\n\r\nRegards,\r\nParmeet Singh.", "updateAuthor": { "name": "paramsb", "key": "paramsb", "displayName": "Parmeet Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-18T09:03:48.000+0000", "updated": "2016-05-18T09:03:48.000+0000" }, { "id": "386090", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "The bug appears to have been fixed in V8, but I don't see any activity on fixes for JavaScriptCore itself, so I have no idea when we'll be able to updated our JSC port with a fix. As a result, this has to get pulled from 5.4.0.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-18T19:00:13.000+0000", "updated": "2016-05-18T19:00:13.000+0000" }, { "id": "429279", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Confirmed that this issue is fixed in upcoming {{Titanium SDK 7.0.0}} nightly build. Note that the sample code in the description is obsolete, I used the sample in the latest [crypto-js|https://github.com/brix/crypto-js] to verify.", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-10-19T07:15:52.000+0000", "updated": "2017-10-19T07:15:52.000+0000" }, { "id": "440159", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:25.000+0000", "updated": "2018-08-06T17:49:25.000+0000" } ], "maxResults": 17, "total": 17, "startAt": 0 } } }