Closed skmohanraj closed 10 years ago
Hi @skmohanraj,
Unfortunately, I'm not too familiar with Titanium Appcelator and don't have any examples readily available. However, it should be possible to use OTR.js in your application.
As an alternative, you can give titanium_otr a try. /cc @mnaamani
thats @mnaamani only for android, i wanna source to ios aloy application. Any way Thanks for Ur Reply...
I also tried these module with the Titanium Appcelator (iOS), I made changes to this module, But still not succeed. I think it's because in the following code in the bitint.js file
var randomBytes = (function () { // in node if ( typeof crypto !== 'undefined' && typeof crypto.randomBytes === 'function' ) { return function (n) { try { var buf = crypto.randomBytes(n) } catch (e) { throw e } return Array.prototype.slice.call(buf, 0) } } // in browser else if ( typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function' ) { return function (n) { var buf = new Uint8Array(n) crypto.getRandomValues(buf) return Array.prototype.slice.call(buf, 0) } } // err else { throw new Error('Keys should not be generated without CSPRNG.') mystery bugs } }())
when i run the project it shows "'Keys should not be generated without CSPRNG" error.
I think the module only supports for browser and node js. I don't know whether this module suits for Titanium Appcelerator.
Please provide suggestion to make it to run on Titanium mobile iOS.
OTRKit suggested by @arlolra is the first step. A titanium module would then have to be developed which wraps it and exposes a javascript API for titanium applications. https://wiki.appcelerator.org/display/guides2/iOS+Module+Development+Guide
Alternatively I could suggest to try and use OTR.js and creating titanium modules just for the missing 'node' components such as the CSPRNG for example.
HI Thanks for ur reply, i upload my titanium project in google drive https://drive.google.com/file/d/0B0dC9rg5ONlvRFNKU2RUNjFIU3c/edit?usp=sharing
I have made changes the modules from arlolraOTR In this project simply i need if i click the "testOtr Button" encrypt a text "haii" shows an Encrypt text as well as Decrypt. when u click the button the key will be genrated at first time so it wwill take some minutes. On that genrated key i used math.random(). but arlolra/otr using CSPRNG. Currently shows the error
"'undefined' is not an object (evaluating 'self[this.meth].bind')"; on 'otr/lib/ake.js'
Actually i don't know is this a correct way to encrypt a text adapt from arlolra/otr. do u have any suggestion?
I'm trying to create a chat application using Titanium appcelerator for iOS. For that i have implemented OTR.JS in my node js application. That works fine, But now i want to implement OTR.JS in Titanium Appcelator.
I searching modules in Titanium Appcelator to implement OTR for my application. But I can't found any solution for this.
So can anyone clarify me, To use OTR.JS in my Titanium Appcelator Application. If there is any example, please suggest me.