jotp: The Java OTP Calculator


Sorry, your browser doesn't do java.

For a page that just has the applet on it, and not the excess verbiage, look here.

What is this?

This is an OTP calculator. OTP is the One-Time Password system also known as S/Key (which is a trademark of Bellcore, so the name OTP is being used increasingly these days). OTP is a system for generating a series of one-time passwords, with which users can authenticate themselves to a remote system without the worry of that password being snooped and re-used to gain unauthorized access to that system by an intruder. Once a one-time password is successfully used, the system will expect a new one-time password the next time, so even though a one-time password can be snooped, it cannot be re-used.

An OTP one-time password is calculated by combining a seed with a secret password known only to the user, and then repeatedly applying either the MD4 or MD5 secure hash algorithms a number of times equal to the sequence number. Each time the user is authenticated, the sequence number expected by the system is decremented.

For a detailed explanation, follow the link to the S/Key paper listed below.

How trusting are you?

I wouldn't recommend typing in your password to a java applet you found on some guy's web page. If you haven't examined the java code that implements this calculator, how do you know that it doesn't initiate a connection back to this web server and log your password? Java-capable web browsers generally allow connections back to the host from which the page was downloaded.

I assure you that I have no such intention, but paranoia would dictate that if you're actually going to use this, that you might consider grabbing the sources, giving them the once-over to look for suspicious activity (like network communication), compile the java source files yourself, and stick the resulting class files somewhere safe. Even if I'm not a bad guy, I can't guarantee that this applet wasn't corrupted by someone else after I put it here. You're welcome to use it straight from here, of course, but consider yourself officially cautioned.

But isn't it stupid to write security software in java when java is insecure?

I believe Ben Stern said it best when he declared: "I told you not to be stupid, ya' moron". While popular belief seems to be that Java has security cooties, and should thus be avoided at all costs, I think we would do well to look closely enough at it to determine when and where it is insecure. When you run a java applet that you downloaded from an untrusted web server (I'll leave the definition of trust as an exercise for the reader), you're taking a chance. Sun has tried to provide sufficient security that you shouldn't have to worry about untrusted apps, but they've obviously not succeeded in this yet, and only time will tell whether we will ever have reason to sufficiently trust java in this role.

However, this doesn't equate the word Java with insecure. I recommend anyone interested in using this or any other security-relevant java applet to apply the same care that they would apply to running any net.software. If you're security-conscious, then you need to grab the software in source form, bring it to your machine, and look through the source as well as you can to look for suspicious behavior (e.g. file or net operations in utilities that shouldn't be doing this), compile it yourself, and run your local copy of the applet. Will everyone actually do this? No, of course not. But I defy anyone to demonstrate that using a java application in this manner is any different than using any other software you downloaded off the net (like the S/Key distribution itself, for instance), it is equally secure (or insecure).

We've come up with an internet that works. We've got all sorts of interesting protocols and plenty of functional client and server software written, and everybody's happy. Unfortunately this whole mess is mostly insecure, and we're going to have to redo an awful lot of it. This is going to entail re-writing a lot of client software, and that means re-writing it for Unix, for Windows, for Macs, and for whatever else is out there. We could sit down and re-write N different versions of these things, or we could re-write them once Java, at least for the first round, perhaps to be replaced with OS-customized versions later. So this is the important role that I see Java playing in the world of, of all things, internet security. It would be foolish of us, IMHO, to overlook java's utility in this role, due to its limitations in other areas.

Is this at all useful?

This was done mostly as an academic exercise, to see what Java was like for writing code that does something real (it's okay, alot like c++, but kinda slow). I thought a java OTP calculator might have some real use, though, in that now you've got an OTP calculator on any platform that has a java-capable web browser. If you actually find this useful, please drop a note to harry@cs.umd.edu. Similarly, if you have any suggestions, complaints, bug reports, let me know. If anyone actually uses this, I might be inclined to try to make it better.

Some OTP-relevant links:

Note: Monopoly is apparently no longer a licensed trademark of the Tonka Corporation, but is now a trademark of the Hasbro Corporation.


Harry Mantakos / harry@meretrix.com