Thursday, July 18, 2013

Update #2

My apologies for the late update. I had to change the track of the project after discussing with my mentor (nextgens) and toad_
Presently, as a starting step, we plan to send signed beacons over the local area network and when the mobile picks it and verifies signature, it raises an intent asking the user to confirm whether it is talking to correct node. If user confirms, the phone pulls the nodereference through fproxy.
I have implemented the same by modifying the official MDNSDiscovery plugin to broadcast fproxy through DSA signed packets. One major modification is, instead of just broadcasting on one network interface, I loop through all network interfaces and broadcast on each one of their netwiorks. This is for people connected to multiple networks (the user maybe connected by bluetooth or wifi to the mobile while connected to internet via Ethernet Adapter).

Though this doesn't solve the problem completely (i.e. the user may connect via a different interface lateron while during our initial scan we found that the particular interface is down), it solves partially atleast for testing purposes.We might have to poll frequently to check if any network interface came alive and start broadcasting on its network
Also, I've used a java properties file to store the private key and public key in Base64 for future signatures. Not sure whether it is the right way (no crypt?)

I made the basic application on mobile phone which looks for multicast beacons and verifies the signature. Though it is in a very nascent stage with a crappy UI, it works. If the signature is verified, it pops an intent with a message asking the user to confirm. Once, the user confirms, it notes the name,ip and port from the broadcast and pulls the node reference through the fproxy link.  "http://" +ip+port + "/addfriend/myref.txt". Also, it stores the name of the node separately. Now the mobile and node can be said to be configured.

Work to be done on step1: USB support, Improving UI, Extensive Testing
How good is an option of synchronizing with the home node only when the user opens our application? The other options include
1) Running a service which runs in the background. Drawback: Severe battery drain since we are dealing with multicast WiFi packets continually.
2) Periodically displaying messages on the notification bar reminding to sync up with homenode
3) A widget which responds to changes in wifi state. If it gets a call from the OS that Wi-Fi state is changed, it checks if the MAC id of access point to be the same as that of home. If it detects home network, then it starts background service Drawback: A little more effort+time, many acces points may be on same network (campus/office WiFi)
4) Same as #3 minus widget plus another background service which does nothing but waits for a callback from OS regarding Wi-Fi. If it finds home MAC id, it starts up the other background service to synchronize. The former could also post notifications if home* is not detected for long time

Suggestions are welcome

Friday, June 14, 2013

Update #1


I have started dealing with easy things for an android port first. One realization was java awt package (images etc.) is not available in android. So, I had to replace all the usages of java awt with their android equivalents (android.graphics package). This is also helpful in objective #1 to handle QR images on android.

Also, I have tested the LZMA compression library and the related fred code on android. It seems to work perfectly i.e. compress and read back cycle using both oldLZMACompressor.java and newLZMACompressor.java.

The github link for android port under development and related testing is https://github.com/NiteshBharadwaj/Fred-Staging-Android 

With respect to QR, I have cloned Operheim's implementation of NoderefQRCode which is a plugin to freenet and can convert node references into QR code and decode them back.

Since, this part is already implemented by Operheim, I have just run a few tests.
I tried to scan the generated QR using popular applications available on google app store. It could decode correctly 7 out of 10 times while 3 times it decoded a random number! 
Using the original decoder (in NoderefQR), it gave similar results except that instead of random number it ran into check sum exception once or twice.

The basic problem I noticed is bigger the size of the string to be decoded, the longer it takes (quite irritating) and more the chances of a wrong decode.

During the planning stage, we thought about using QR codes only to establish Wi-Fi Direct connection between two mobiles. The actual node references are exchanged via Wi-Fi direct. This seems a better option compared to encoding whole nodereference in QR (We could provide multiple options anyway). The high band-width during such transfer can also be utilized for sneakernet support later on. 

Monday, May 27, 2013

May 27!

Results are announced and this project is officially selected to be a part of Google Summer of Code 2013

Project Title:   Android suppport for secure Darknet connections and an Android port of Freenet

Mentoring Organisation:        The Freenet Project
Mentor:                                   Florent Daignière


 After a series of consultations with my mentor and other developers, the priorities are changed. Now, higher priority is given to establishing secure darknet connections on a client application of freenet compared to porting freenet. Also, synchronising and exchange of datastores (pseudo-sneakernet) has been excluded as of now. This is mainly because of the time-constraints.


Objective:

To develop an android application, (herewith called NC Node), based on QR and Wi-Fi Direct that can securely exchange node reference of its parent node (normal Freenet node running Fred-Staging code, with minor modifications, herewith called C-Node) with node reference of another NC Nodes' parent when two NC nodes meet.
(Note: An NC and corresponding C Node are owned by the same person)

To develop a method to connect NC node and its parent securely at home. Adding functionality so that, the NC node and its parent are 'synced' periodically whenever they are in geographical proximity.

To port fred-staging code to android i.e. to create C-Nodes that can work on android platform.

Sunday, May 19, 2013

First Post


Through this blog, I would like to publish my weekly updates regarding the GSOC 2013 project

"FREENET PORT ON ANDROID - UTILIZING QR AND WI-FI DIRECT TECHNOLOGIES"

Short Description:

A P2P platform like freenet should definitely have an Android version. Since it is a resource intensive application, it might consume a lot of battery/data. My objective is to utilize the technologies, pre-built into android (Wi-Fi direct and QR), to save upon battery/data and to make it user friendly where ever possible. 

The power problem is overcome by making two versions of the application, a resource intensive and a light weight. The resource intensive application runs on laptops,homeservers etc. while light weight application on android mobiles. These two applications communicate with each other over Wi-Fi direct (i.e. no data/internet connectivity is required). 

We plan to use QR code as a means to establish darknet connections. Two nodes connect when they scan each other's QR codes. This provides a very user friendly and secure alternative to run darknet in a censored environment. 

Finally, we plan to utilize Wi-Fi direct for exchanging popular content on the data stores when two nodes meet. This lessens the burden on actual internet connectivity 

With smart phones, smart cameras and smart TV sets evolving this project appears rewarding

Objective:

To port freenet to android and to make two versions of the program. One meant for nodes with solid internet connection (herewith called C-Nodes). These could be laptops or desktops or home servers running on android platform. These would be running the original fred-staging with only minor modifications. This application would consume a fair amount of data as well as battery.Second meant for nodes with little or no internet connectivity and having battery constraints (herewith called NC-Nodes). This is a light weight application and can be run on low end/ normal smart phones. These nodes exist along with C-Nodes and do not exist independently.

  • Porting freenet to android and getting it to work
  • Using QR codes to securely exchange node references
  • Working with Wi-Fi direct and establishing a secure connection between an NC-Node and its parent C-Node 
  • Adding automatic sync functionality that syncs the data-stores and darknet peer list on NC node and its parent C-Node when they are in geographical proximity
  • Establishing a connection between NC node and darknet peer C-Nodes.
  • Adding functionality to route some of the requests of NC through peer C Node
  • Adding functionality to use QR codes to securely exchange node references between NC nodes 
  • Adding functionality to exchange popular content of their data-stores whenever two NC nodes meet

Mentoring Organisation: Freenet
Mentors: To be declared on May 27

The official starting date of the project is June 17, but I have already started preliminary work including compilation of wrappers and libraries suitable for android

- Nitesh Bharadwaj