Tuesday, December 24, 2013

Usbong Update (Dec. 23, 2013): Simple Encrypt/Decrypt = OK

Hi everyone,
I know Christmas and the New Year 
are just around the corner,  but before 2013 ends, 
in behalf of the team, I'd like to inform you 
about a quick update on Usbong.

Data Encryption/Decryption is now working!

I. How it works (attached are screenshots):
A. Encryption
1) You first fill out the fields in your usbong tree,
e.g. patient name, gender, birthday.
2) By using the "simpleEncrypt" node,
you can have a screen where you or the user 
inputs any 4-digit PIN code. This will act as your key,
and will be necessary when you decrypt the data later on.
3) Once you hit next, Usbong will encrypt
all your answers up to that point.
4) You can then use the "sendToCloudBasedService" node
to optionally send that data to the cloud (e.g. gmail, dropbox).

B. Decryption
1) To decrypt, get your data which you sent to the cloud,
or which has been stored in your sd card, 
and then copy-paste it to the text area of this website.


2) Input your PIN code
3) Hit "Submit"
You should now see your decrypted data.

II. simpleEncrypt node in XML
Here's what the simpleEncrypt node looks like in XML.
<task-node name="simpleEncrypt~Encryption Node">
<transition to="sendToCloudBasedService~Send data to the cloud?" name="Any">           </transition>
</task-node>

III. Sample Usbong Data
The data Usbong encrypts and which you can decrypt 
is basically the end-user's answers to the tree.
For example...
Encrypted: K;K,Wsuo;a;K,Nomcd,cabd;K;Y;
Decrypted: A;A,Mike;0;A,Dec23,2013;A;O;

Take note though that the last two characters, 
i.e. "Y;", are not encrypted. Why?
The encryption node encrypts all the answers
up to the encryption node itself; 
all data after it will not be encrypted.
The last node in the example was actually 
the sendToCloudBasedService node, 
which outputs a "Y;" if you select Yes
when asked if you want to send data to the cloud.

Typically, you'll want to put the encryption node
towards the end of your usbong tree,
and then reserve the last node 
for sending data to the cloud or a web server.

To be honest, the encryption algorithm 
we're using here is relatively not complex. 
It's actually a modified version of ROT-13
.

I initially played around with AES
 
(Advanced Encryption Standard),
but realized that creating a web server
that handles the decryption process
would be a lot harder to pull off.
The alternative would be to have the user
run a java program that decrypts the data,
but this would require more technical know-how.

So I opted for what is simpler to implement,
at least for the time being.
The important point is that usbong data 
can now have a layer of security, 
which would prevent most people 
from easily decyphering sensitive info
such as patient data, etc.

If you have any questions, or need me to clarify something,
feel free to drop me an email or voice them out via:

If you downloaded Usbong via Google Play,
you should be able to get the updated version
within a few hours after receiving this email.

If you want to check out the code,
I've updated Google Code.

Well, happy holidays, everyone!

Cheers,
Mike
p.s. Special thanks to udacity.com
's cs253-Web Application Engineering/Web Development
, where I'm learning how to develop web apps using Google App Engine and Python.