One-Time Passwords
Pages: 1, 2
Logging In
At this point I also have a choice: I can either use the calculator from a separate terminal every time I login, or I can print myself a list of responses and regenerate a new list whenever I run out of responses. Let's try both methods, starting with the first:
login: dlavigne6
otp-md5 498 dh0391 ext
Password:
Notice that when I login, I receive an OTP challenge.
opie is waiting for the response, or one-time password,
associated with counter 498. By default, users can decide whether or not
to use OTP when they login. If I decide instead to type in my reusable
password, it will be accepted and I'll login as usual.
If I decide to login using OTP, I'll first need to calculate the correct response. It doesn't matter where I use the calculator, as long as i don't use it over a non-encrypted network connection. I could use the calculator from another virtual terminal; for example, I could press Alt-F3, login locally and run the calculator. Alternately, if I have access to another computer in the room, or even a Palm Pilot running the calculator software, I could calculate the response there.
In order to use the calculator I need to know three things:
- the current counter
- my seed
- my secret pass phrase
The current counter and seed are displayed in the challenge. However, it is important that only I know my secret pass phrase; otherwise, anyone could calculate the response and login as if they were me.
When I use the calculator, I include the count I need the response for as well as my seed:
$ opiekey 498 dh0391
Using the MD5 algorithm to compute response.
Reminder: Don't use opiekey from telnet or dial-in sessions.
Enter secret pass phrase:
MASK BALM COL HER RIFT TERM
Note that I was prompted for my secret pass phrase, then given the
response associated with counter 498: MASK BALM COL HER RIFT
TERM.
Now that I know the correct response, I can return to my login prompt:
login: dlavigne6
otp-md5 498 dh0391 ext
Password: (here I pressed enter)
otp-md5 498 dh0391 ext
Password [echo on]: mask balm col her rift term
This time, instead of typing my reusable password, I pressed Enter which turned on echo. This allowed me to see the response as I typed it. Echo is a bad thing with reusable passwords which is why it is always off. However, with a one-time password, it doesn't matter if anyone sees me typing it as it can't be reused. Also, unlike a reusable password, the response is not case sensitive so it doesn't matter if I type it in upper or lower case.
Now if I do an opieinfo, I'll see that the next expected
response will be for counter 497. That is, every time I use a one-time
password, the counter is decreased by one. I can merrily continue to
calculate and use up my responses; I need only be careful that I never let
my counter decrease to 0.
Generating Multiple Keys
It may not always be convenient to use the calculator every time you want to login. Let's demonstrate the second method, where a list of responses is generated.
This time, I'll use the number or n switch with the
calculator, to indicate how many responses I'd like to calculate. Here,
I'll generate a list of 10 responses, starting at the next expected count
of 497:
$ opiekey -n 10 497 dh0391
Using the MD5 algorithm to compute response.
Reminder: Don't use opiekey from telnet or dial-in sessions.
Enter secret pass phrase:
488: COIN LO DOG GOLF ACTA FULL
489: SOD STUN SINK DRAW LAWN TILT
490: MALT STAY MASH CAR DEBT WAST
491: HOWE DRY WALL TOO BUDD SWIM
492: ROOT SPY BOND JEST HAIL SCAR
493: MEAN ADD NEON CAIN LION LAUD
494: LYLE HOLD HIGH HOME ITEM MEL
495: WICK BALI MAY EGO INK TOOK
496: RENT ARM WARN ARC LICE DOME
497: LEAD JAG MUCH MADE NONE WRIT
I now know what my next ten passwords will be. At this point, I could copy them to a piece of paper and store them in a safe place such as my wallet. Alternately, when you generate your own list, you could send the output to a file like so:
$ opiekey -n 10 497 dh0391 > secretlist
and print the list. Be careful to remove that file from your hard drive once you've printed it as you don't want to keep a copy of your next ten passwords on your hard drive.
If my counter gets dangerously low, say around 10, I should reset it using
the opiepasswd command. Once you're in the password database, use
the n or number switch in combination with the s or
seed switch instead of the c switch. In the next example, I'll
reset the counter back to 499 and change my seed to dh1357. When I do so, I'll
be prompted for the response associated with my current counter, which happens
to be 8:
$ opiepasswd -n 499 -s dh1357
Updating dlavigne6:
You need the response from an OTP generator.
Old secret pass phrase:
otp-md5 8 dh0391 ext
Response: loot omit safe eric jolt dark
New secret pass phrase:
otp-md5 499 dh1357
Response: hewn as dot mel mali mann
Finishing Up
At this point, you may be wondering when would be the best time to actually use OTP, since you have a choice of using either OTP or a reusable password whenever you receive a login prompt. You probably won't use OTP when you login to a remote computer as you should use SSH for that purpose. Since SSH ensures that all of your information is encrypted, it has no need for OTP and hence does not support OTP. However, OTP can be appropriate when you need to login to your computer and you are concerned about "shoulder surfing" or someone else noticing your password as you type it in. For example, you may be in a crowded area with your laptop. Your computer may happen to be located in a high traffic area, which increases the possibility of someone noticing what password you use to login.
It is convenient to leave users with the choice of using or not using
OTP depending upon the likelihood of someone else noticing their password
when they need to login. It is also possible to change this default and
configure your FreeBSD system to force users to always use OTP. The
original way to do this was to create a file called
/etc/opieaccess. However, this method is considered to be a
security hole and is even cautioned against in man
opieaccess.
The preferred method is to use Pluggable Authentication Modules (PAM). Since I want to spend a fair bit of time on PAM, I will end this week's article here. In the next article, I'll introduce PAM, then carry on by configuring OTP as an example.
Dru Lavigne is a network and systems administrator, IT instructor, author and international speaker. She has over a decade of experience administering and teaching Netware, Microsoft, Cisco, Checkpoint, SCO, Solaris, Linux, and BSD systems. A prolific author, she pens the popular FreeBSD Basics column for O'Reilly and is author of BSD Hacks and The Best of FreeBSD Basics.
Read more FreeBSD Basics columns.
Return to the BSD DevCenter.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 11 of 11.
-
Something for the Pocket PC ???
2005-07-27 12:49:09 shadox [Reply | View]
http://www.awe.com/mark/dev/otp/
-
The Future of Internet Security
2004-07-06 10:10:38 Arnnei [Reply | View]
It is a known fact today that the Internet Security is most vulnerable at the Login entry.
No SSL or other protocols will prevail if your Password is exposed.
The most secured and affordable methodology available today is the TFA (Two Factor Authentication) and OTP (One Time Password) generation.
These methods cost a bundle with today Token system. That is the reason only VIPs or very secured sites offer this level of security to their clients.
Change the Token system in a way that every organization can offer it to their customers, and you get a high level of security for everybody.
Mega AS Consulting Ltd (www.megaas.co.nz) has developed a new CAT (Cellular Authentication Token) that follows that thought. It is a new concept that enables new services such as eAuthentication. The CAT runs on a cellular, does not require SMS or any type of communication and can be installed (one time OTA) by any Services client. It does not cost the user anything.
With this in mind, Services can now offer the users the option to register to a secured OTP login, at their own time. The Service does not have to supply or manage the tokens. It is the users responsibility to join the secured service to secure his login.
The eAuthentication Service takes this approach even further. Since the user can choose to join the secured Login of the Service, the company providing the service does not have to buy the Authentication package anymore, they get the users authenticated at Mega AS Consulting CAT Authentication server by implementing a simple API.
This approach is new. It will change the whole industry and it is available now.
-
OTP Calculator for the palm
2004-05-01 16:36:35 pawalan [Reply | View]
The OTP calculator for the palm is called pilOTP and can be downloaded at http://astro.uchicago.edu/home/web/valdes/pilot/pilOTP/.
It's freeware.
-
What's the point?
2003-02-23 18:01:06 anonymous2 [Reply | View]
What's the point? People can still calculate your one time password if they know your passphrase, or login with your reusable password, this only gives people more acceptable passwords to be able to login to your system as. This is not making your machine MORE secure, but LESS secure by giving people more oppurtunities to login under your username.
I see no real use for something like this. Are you that incapable of remembering to change your password on a regular basis? And is having a list of passwords written down on a piece of paper in your wallet really that secure? It's easier to pick a pocket than hack a password.
-
one time passwords - older than this
2003-02-11 09:30:19 anonymous2 [Reply | View]
I remember using one time passwords back in the late 70's, for a semi-public computer system, at Indiana University. The list of passwords was kept behind the librarian's desk, and they were handed out one at a time as a terminal became available.
Wish I could remember what the system was called... early plasma screens, CAE programs, .. I remember one simulation of the sociology of birds on a telephone wire :) Ah!!! PLATO. Yes... that was it. Fun system for its time.
-
A (long) list of OTP software is needed
2003-02-10 20:31:18 plaw [Reply | View]
It would be helpful if a (long) list of OTP password generation programs was provided. For example, it is mentioned in the article that there is one for Palm pilots. Indeed, the URL for the OPIE home page would be helpful. (And, yes, I know how to google. It is still helpful to see what others have found, and found useful.)
-
An utility for OTP
2003-02-08 12:10:11 anonymous2 [Reply | View]
One reason to use OTP is that you don't trust the computer you're one, for example in a library or any computer that you don't own. In this situation, you don't know if SSH or the keyboard are backdoored, so using OTP ensure that even if they catch your password, they can't do anything with it.
GFK's


