webOS Nation Forums >  webOS Discussion >  Open webOS General Discussion > Ima Newb with an OTR idea
Ima Newb with an OTR idea
  Reply
 
Thread Tools Display Modes
Old 11/07/2012, 01:58 AM   #1 (permalink)
Member
 
Posts: 12
So i really want to be able to OTR message on webos. I am using a pre 3 to let you know.

This looks like a working OTR implementation deved in Javascript:

https://github.com/arlolra/otr

I'm a total newb but want to see something like this on WebOS and have the time to work on it.

But I need help from people who know what they are doing


Can this be implemented on WebOS?

Last edited by OldSkoolVWLover; 11/07/2012 at 04:34 PM. Reason: <fixed title>
schwasskin is offline   Reply With Quote
Old 11/07/2012, 04:49 AM   #2 (permalink)
Member
 
Posts: 12
Ok so i've done some more research and I want to start with GTALK and XMPP. These are the requirments:

The service is hosted at talk.google.com on port 5222
TLS is required
The preferred authentication mechanism is OAuth 2.0
SASL PLAIN is supported for legacy clients


Also been looking at the code from the link in my first post and this is some code I thought would be useful thus far:

<script src="http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/aes.js"></script>
<script>
var encrypted = CryptoJS.AES.encrypt("hey", "Secret Passphrase");

var decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase");

alert(decrypted.toString(CryptoJS.enc.Latin1));

</script>

This will encrypt the "message" with "secret passphrase" as the key and then decrypt it in the same fashion.
schwasskin is offline   Reply With Quote
Old 11/07/2012, 04:20 PM   #3 (permalink)
Member
 
Posts: 12
Been working on sending IM's and I thought I would start from the CLI
The following ran from novaterm opens the app with the fields filled out on my Pre3 but the I get an error

"Unable To Send
You are attempting to send to an IM type for which you do not have an account to send from"



Code:
luna-send -n 1 luna://com.palm.applicationManager/launch '{"id":"com.palm.app.messaging","params":{"composeRecipients":[{"address": "myaddress@gmail.com","serviceName":"gmail"}],"contactPointId":"recipient@gmail.com","messageText":"How are you?",}}'
Created the code from this site, and it says the serviceName should be "gmail" so im stumped.

Anyone want to chime in on this with me?

Code:
luna-send -n 1 luna://com.palm.applicationManager/launch '{"id":"com.palm.app.messaging","params":{"composeRecipients":[{"address": "me@gmail.com","serviceName":"gmail"}],"contactPointId":"reciver@gmail.com","messageText":"How is class?",}}'

So im kinda stumped seems like a permission issue, but im running it through novaterm as root.

Got the code info from this site
https://developer.palm.com/content/a...ng.html#syntax

lets get some minds on this I really want to have OTR messaging on my Pre3

<staff edit - dup infor removed>

Last edited by OldSkoolVWLover; 11/07/2012 at 04:33 PM. Reason: dup posts - merged - errors are slightly different
schwasskin is offline   Reply With Quote
Old 11/07/2012, 07:52 PM   #4 (permalink)
Homebrew Developer

 
Posts: 3,303
I'm confused - what does this do?
__________________
Author:
Remove Messaging Beeps patch for webOS 3.0.5, Left/Right bezel gestures in LunaCE,
Whazaa! Messenger and node-wa, SynerGV 1 and 2 - Google Voice integration, XO - Subsonic Commander media streamer, AB:S Launcher
Quote:
(1:39:33 PM) halfhalo: Android multitasking is like sticking your fingers into a blender
GO OPEN WEBOS!
People asked me for a donate link for my non-catalog work, so here you are:
eblade is offline   Reply With Quote
Old 11/07/2012, 08:02 PM   #5 (permalink)
Member
 
GMMan's Avatar
 
Posts: 2,136
Quote:
Originally Posted by eblade View Post
I'm confused - what does this do?
I'm guessing it prevents your service provider from logging your conversations. Suppose you don't trust your service provider enough, or OTR can't be enabled from within webOS. You then request OTR delivery, with a shared secret (or public key authentication, haven't read thoroughly), and encrypt outbound messages. Your message is then decrypted by the receiving client, and displayed.
__________________
Contact: @GMMan_BZFlag (me on Twitter)
webOS Releases: Change your App Catalog country: TouchPad/PC | TouchPad/webOS Resources | Search suggestion patch for browser | Cycling Email Notifications | Don't Doctor! Make a good support request. | How to post logs | webOS Charge Monitor
GMMan is offline   Reply With Quote
Old 11/08/2012, 11:19 AM   #6 (permalink)
Member
 
Posts: 12
Correct. Its private encryption between you and the distant end. It works really well with gibberbot for android and Pidgin on the PC. So google cant sell you out.

Anyone able to look at the


luna-send -n 1 luna://com.palm.applicationManager/launch '
{
"id": "com.palm.app.messaging",
"params": {
"composeRecipients": [
{
"address": "soccer.lover31289@gmail.com",
"serviceName": "gmail"
}
],
"messageText": "Wheredidyougetthis"
}
}'

and see why I cant send with gmail? Phone says I dont have an account and I do.
schwasskin is offline   Reply With Quote
Old 11/08/2012, 12:41 PM   #7 (permalink)
Homebrew Developer

 
Posts: 3,303
from /usr/palm/public/accounts/com.palm.google

Code:
        {                                                                                           
                "capability": "MESSAGING",                                                          
                "capabilitySubtype": "IM",                                                          
                "id": "com.palm.google.talk",                                                       
                "loc_shortName": "Google",                                                          
                "icon": {                                                                           
                        "loc_32x32": "images/gtalk-32x32.png",                                      
                        "loc_48x48": "images/gtalk-48x48.png",                                      
                        "splitter": "images/gtalk-32x32.png"                                        
                },                                                                                  
                "implementation": "palm://com.palm.imlibpurple/",                                   
                "onEnabled": "palm://com.palm.imlibpurple/onEnabled",                               
                "readOnlyData": true,                                                               
                "serviceName": "type_gtalk",                                                        
                "chatWithNonBuddies":false,                                                         
                "dbkinds": {                                                                        
                        "immessage": "com.palm.immessage.libpurple:1",                              
                        "imcommand": "com.palm.imcommand.libpurple:1"                               
                }                                                                                   
        },
__________________
Author:
Remove Messaging Beeps patch for webOS 3.0.5, Left/Right bezel gestures in LunaCE,
Whazaa! Messenger and node-wa, SynerGV 1 and 2 - Google Voice integration, XO - Subsonic Commander media streamer, AB:S Launcher
Quote:
(1:39:33 PM) halfhalo: Android multitasking is like sticking your fingers into a blender
GO OPEN WEBOS!
People asked me for a donate link for my non-catalog work, so here you are:
eblade is offline   Reply With Quote
Old 11/08/2012, 11:50 PM   #8 (permalink)
Member
 
Posts: 12
Great find with the serviceName: type_gtalk


But that still just sends to email, just like it does when I leave the value empty.

But its an improvement. The only entry I have used that doesnt result in the error.
schwasskin is offline   Reply With Quote
Old 11/08/2012, 11:59 PM   #9 (permalink)
Member
 
Posts: 12
Ok so I changed the address field to the users gtalk name instead of email and it actually launched the talk app portion but I got a knew error could not send message

Big thanks to eblade for the type_talk find.

EDIT:
UPdate:

Ok so this works

luna-send -n 1 luna://com.palm.applicationManager/launch '{"id":"com.palm.app.messaging","params":{"composeRecipients":[{"address": "recipient@gmail.com","serviceName":"type_gtalk"}],"messageText":"How are you?",}}'

NIIIICE.
The problem with it not sending was the contact had the same email in the gtalk IM section as the email address section in thier profile. That is just how it imported from google ?????? But anyway got it working now gotta encrypt it.

Last edited by schwasskin; 11/09/2012 at 12:34 AM.
schwasskin is offline   Reply With Quote
Old 11/09/2012, 12:44 AM   #10 (permalink)
Member
 
GMMan's Avatar
 
Posts: 2,136
You can add a new button into the GUI that calls your code for the current chat session. Have you considered making this into a service?
__________________
Contact: @GMMan_BZFlag (me on Twitter)
webOS Releases: Change your App Catalog country: TouchPad/PC | TouchPad/webOS Resources | Search suggestion patch for browser | Cycling Email Notifications | Don't Doctor! Make a good support request. | How to post logs | webOS Charge Monitor
GMMan is offline   Reply With Quote
Old 11/09/2012, 12:25 PM   #11 (permalink)
Member
 
Posts: 12
I am open to all considerations. And a button in the current gui would be great. This is my first attempt at any app dev for this device and im a total JS newb too lol. So i will need help but I want this to work.
schwasskin is offline   Reply With Quote
Old 11/09/2012, 12:34 PM   #12 (permalink)
Member
 
Posts: 12
Quote:
Originally Posted by schwasskin View Post

Ok so this works

luna-send -n 1 luna://com.palm.applicationManager/launch '{"id":"com.palm.app.messaging","params":{"composeRecipients":[{"address": "recipient@gmail.com","serviceName":"type_gtalk"}],"messageText":"How are you?",}}'

So if i have this address as email and gtalk address in contacts it just sends at txt. I have to delete the contact as a email account and just leave as Gtalk to send to gtalk. Not a problem except that way I dont have an email address I can use for this contact

So I have hit a big road block. If the Gtalk account you are sending to is the same as the email address for that contact. It sends it as an email.
Not sure why it does that. Any Ideas?

Last edited by schwasskin; 11/09/2012 at 06:11 PM.
schwasskin is offline   Reply With Quote
Old 11/12/2012, 08:29 AM   #13 (permalink)
Homebrew Developer
 
Posts: 773
You should still follow the idea to modify the original messaging app (i.e. create a patch for that)... so you don't have to care for the e-mail issue... the messaging app doesn't seem to have your issues.

I would advise you to read a tutorial on how to create a node.js service and how to use it from a simple app... I think there should be something like that on developer.palm.com.

I would then create a service that has one method to encrypt something and a method to decrypt something. That, together with a simple app, where you can type in one text-field, hit "encrypt" and get the encrypted stuff in another field and vice-versa would then be the next step to test your stuff... of course the app should call your service's methods. :-)

Now, you have some knowledge and tried around a bit... you then can have a look in /usr/palm/applications/com.palm.app.messaging and try to find out where to best add a button that calls your service to encrypt a message if you hit the button and replace the text in the textfield with an encrypted version...
and you can then try to find out where messages are received and displayed in a conversation and try to hook your decryption code there (IIRC OTR sends some "signature" so encrypted messages can be detected).

Of course you need something to store the secrets... I would just try to pimp the contact data with some additional field for that... you might, again, have to modify the messaging app to let you insert the secret into a certain contact... so you could make a "wizard" to activate encryption for a certain contact in the messaging app (or if you like in the contacts app). This would be a major modification/patch. Alternatively you can do that in another app... but that then must be called com.palm.application.something to have access to the contacts.

If you really want to digg through that, then this would be a nice project to learn and it should not be too complicated for a starter... at least until you get to modifying the messaging app... but I think people can help with that... first try to implement the encryption service and a simple test app for that. Will be enough of a tutorial to show that you are really dedicated to your idea.
Garfonso is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0