Posted on 4 Comments

The Making-of an Android App

UnJumble
I have been developing mobile web apps since quite some time now, mostly using popular JavaScript frameworks, like Sencha Touch, which give a native look & feel to the app. Web apps have their merits, but using a platform’s SDK in order to develop a true native app is is inevitable in cases where you exclusively want your app to be available offline and also leverage some OS niceties that are unavailable to plain JS apps.

I recently got into developing a small, simple, but useful app for Android using using their latest API (level 16). The app — UnJumble — takes as input a jumbled English word, searches through a database of 58,000+ words for possible matches, and displays unscrambled word suggestions based on matches. As an added bonus, UnJumble fetches meanings for each unjumbled suggestion from Wordnik. Of course, the user gets to enable or disable the fetching of meanings as querying Wordnik requires an Internet connection, and this process may be a bit slow in some cases.

I’m currently in the process of giving finishing touches to UnJumble to prepare it for publishing on Google Play store. UnJumble is now available on Google Play. Throughout the journey of its development, I learned a lot of cool things about developing Android apps. In this article, I’ll share what all I learned by methodically teaching you how to build your own Android app using the several “components” I used to create UnJumble. But I’ll assume you’ve read at least a couple of tutorials on the Android Developers website, and that you are fairly familiar with a handful of Android SDK’s major terms and components.

Get ready to read about the journey of an Android app from its development to publishing.

Complete source code for UnJumble can be found at its github page.

Continue reading The Making-of an Android App

Posted on 4 Comments

Unjumble — You won’t lose that jumbled words game again

Unjumble

Another of my free time exercises, Unjumble does just that – it unscrambles a jumbled/scrambled word into all possible English dictionary words that can be formed out of that jumbled word. The interface is extremely simple. You have a textbox to input your jumbled word, and as you type, all unjumbled word suggestions start appearing as list items in the combobox below. To copy an unjumbled word to clipboard, just click on it. Simple, isn’t it?

Like QuickCopy, Unjumble was coded in C#, and makes use of SQLite as the portable database to store a huge list of English dictionary words. What’s the most interesting thing about this little app is the algorithm behind it.

There is a pre-prepared database of almost all (58000+) English words [wordlist.txt], stored along with their hashes (words formed by the original words’ individual alphabets in sorted order). The input jumbled word’s hash is then calculated in a similar way, and is compared with the hashes stored in the database. All matches are then displayed in the list box.

I bet, using Unjumble, you’ll never lose your newspaper’s jumbled words game again. 😉

Download: Source Code (1.5 MB) – Installer (1.7 MB)

Posted on 2 Comments

QuickCopy — No typing that password again

QuickCopy

A very simple password management tool that I developed in my free time. It aims to simplify the task of copy-pasting frequently used text, like usernames and passwords. A Windows-only tool, it’s code purely in C#, and makes use of the wonderfully portable SQLite to store entries in the backend. The interface includes 2 components (basically 3; one is hidden) — system tray icon and “add content” dialog. All content added through the dialog gets added as a menu item in the system tray icon’s context menu (the one you see on right-clicking the icon). To copy a content from the menu to the clipboard, all you need to do is just click on its entry in the menu and it’s done!

Some features:

  • Store content – frequently used text, like usernames.
  • Store passwords – these are masked by content tags, which are then shown in the context menu (in red color).
  • Hotkeys – the top 3 entries in the context menu can be quickly copied to the clipboard using the key combinations of CTRL+F1, CTRL+F2 and CTRL+F3.

For a password, its respective content tag acts as a mask to hide it under its name. Say you’re adding your Gmail password @ILuvKatz!! in the dialog, and set its content tag as Gmail Password, the password’s entry will appear in the menu in red color with the name Gmail Password. When you click on Gmail Password, your actual password will be copied to the clipboard.

There is no easy provision of modifying existing content entries. But I’ve provided a QueryEditor (invoked by pressing CTRL+Q in the “Add Content” dialog), where you can change the content entries by issuing your regular SQL queries. For example:

UPDATE content SET content='@IHateKatz!!' WHERE content_tag='Gmail Password'

Download: Source Code (1.1 MB) – Installer (1.2 MB)

Posted on 2 Comments

Granular Package Archive

rpm_logoContinuing my Java learning stint, I started experimenting on RPM packages in the Granular 2008 repository by extracting meta data from them using various Java classes I had written for my on-going college major project. To give a shape (end-user interface) to these leisurely done Java programs, I used my existing project MyBlog to create a website that could display information (extracted by the Java programs) about every RPM package in the repository. In other words, the Java programs store information about each RPM package in a central database which in turn is used by a PHP-based website to display that information, and much more.

In the introduction to Granular Package Archive post I wrote on the Team Granular blog, I explained the various features it has to offer. My personal favorite is the ability to leave comments on individual RPM pages. Other than that, I am quite satisfied with the overall look-and-feel too. In another of my Team Granular blog post, I explained the working of this package archive system, and the way to use it with any other repository of RPM packages.

Some guys at the Unity Project are also contemplating the idea of using this package archive system with their repository too.

Posted on 5 Comments

Use SMS English to make monoalphabetic cipher more secure

This thought occurred to me when I was preparing for my end-semester exam of the Information Security Systems course. The course was all about computer networks, security, and cryptology. Before I come to the topic of this post, let me give a brief introduction to Monoalphabetic ciphers.

Monoalphabetic cipher is a way to encrypt data (convert data into a secret form) by substituting each alphabet of the message to be encrypted with some other alphabet such that the substitute alphabet chosen for each alphabet remains constant throughout the message.

Accourding to simonsingh.net:

The ciphers in this substitution section replace each letter with another letter according to the cipher alphabet. Ciphers in which the cipher alphabet remains unchanged throughout the message are called Monoalphabetic Substitution Ciphers.

Suppose we want to encrypt the following message:
Meet me today at twelve

If we choose to substitute the letter “e” with, say, “u”, the letter “m” with “a”, the letter “a” with “c”, the letter “t” with “n”, and so on…, we’ll get the encrypted text like this:
auun au nyxcz cn npukbu

When you pass this message to your friend to let him decrypt it (convert it back into the original message), it would be assumed that it’s only you and your friend who knows the letter mappings – as to which letter was substituted for which. It seems pretty efficient way of sharing secrets? But, nope, it isn’t that efficient as it can be easily broken.

The most common and simplest way to break a monoalphabetic cipher is by guessing each alphabet in the encrypted text by using the help of a table/graph containing the relative letter frequencies in English language. Consider the frequency chart as follows:

As you can see from the above figure that the most used letter in English language is “e”, followed by “t”, then “a”, then “o”, then “i”, and so on…

Now looking at out encrypted text “auun au nyxcz cn npukbu”, it can be noticed that:
the letter “u” occurs 5 times (most times)
the letter “n” occurs 4 times (second-most times)
the letter “c” occurs 2 times (third-most times)

So, the first guess would be:
“u” was substituted for “e”
“n” was substituted for “t”
“c” was substituted for “a”

Using this much analysis, we try to decrypt the text as:
_eet _e t__ay at t_e__e

So you see, it wouldn’t be hard from here on to guess the original message as “meet me today at twelve”.

But this task of breaking the cipher (cryptanalysis) could have been made more difficult for the “hacker” by using SMS English. Suppose we wanted to encrypt this message:
come for tea at club see you there

Now before encrypting this message, you first convert it into SMS English:
cm 4 t at klub c u dere

With this converted text, proceed with the normal monoalphabetic substitution, and make sure your message target (probably your friend) already has the letter mapping. The encrypted text would be very difficult to break as mere guessing of letters using letter frequency table would lead to revelation of utter gibberish. And there are no letter frequency charts (or at least none I could see) for SMS language.

So all you SMS addicts, worry no more. You can finally utilize your skills for some good cause. 🙂