The TOTP program is a command line utility that creates Time-based One-Time Passwords based on the computer's clock and a secret.
ecsoft2 is moving to a new platform!
Thanks to everyone who answered our call: the site will be upgraded and will stay online, with all its content and user accounts. Over the coming months you may notice some changes. If you’ve already written to us, we’ll be in touch once the new site is ready. If you’d like to help keep the catalog up to date, ggamba
tiscali [dot] it (get in touch)!
Program is distributed as ZIP package: download to temporary directory and unpack to destination folder. See below for download link(s).
Following ones are the download links for manual installation:
| TOTP & TOTP for OS/2 Presentation Manager v. 2.0 (28/11/2026, Axel Meiss) | Readme/What's new |
PMTOTP - time-based one-time passwords for OS/2 Presentation Manager
====================================================================
PMTOTP generates the six to eight digit codes that web sites and
services ask for as a second factor (TOTP, RFC 6238) - the same codes
an authenticator app on a phone shows. It runs on OS/2 and eComStation,
keeps its entries in a plain text file, can copy a code to the
clipboard, and can encrypt the secrets in that file with a master
password.
Algorithms: SHA-1, SHA-256 and SHA-512. Digits: 6 to 8. Interval: 1 to
86400 seconds (usually 30).
Starting the program
--------------------
pmtotp [file]
Without an argument the program reads TOTP.TXT in the current
directory. With an argument it uses that file instead.
The codes depend on the system time. Make sure the clock and the time
zone of your OS/2 system are correct (TZ setting), otherwise the codes
will not be accepted by the service.
Using the program
-----------------
The main window is a list of the entry names.
* Double-click an entry, or select it and press Enter: a dialog shows
the current code and the remaining time in seconds. The code is
shown in red during the last sixth of its interval and changes by
itself when the interval ends.
* OK (or Enter) closes the dialog and copies the code to the
clipboard as plain text, digits only. Cancel (or Esc) closes it
without copying anything.
* F5 reads the file again, for example after you changed it with a
text editor. Errors, such as lines that could not be read, are
shown in the title bar.
Menu and keys
-------------
File
New ... Ins create an entry
Modify ... F2 change the selected entry
Delete Del delete the selected entry (asks first)
Password ... set or change the master password
Quit end the program
Help
About ... copyright notice
The entry dialog has one field each for name, secret, algorithm,
digits and interval. Tab and Shift+Tab move between the fields, Enter
means OK and Esc means Cancel.
Name letters (A-Z, a-z), digits, underscore, hyphen and dot,
up to 47 characters. A name that is already in the file
and is left unchanged is accepted as it is.
Secret the base32 key you get from the service. Lower case,
blanks and dashes are tolerated; the program stores it
as clean upper case.
Algorithm SHA1, SHA256 or SHA512 (empty = SHA1).
Digits 6, 7 or 8 (empty = 6).
Interval 1 to 86400 seconds (empty = 30).
OK checks all fields and shows a message instead of saving if
something is wrong, so an invalid entry can not get into the file.
The file TOTP.TXT
-----------------
One entry per line:
Name:SECRET
Name:SECRET;ALGORITHM,DIGITS,PERIOD
The secret follows the LAST colon of the line, so an older file may
contain colons in a name. The part after the semicolon is positional;
an empty field keeps its default (SHA1, 6 digits, 30 seconds):
# comment
GitHub:JBSWY3DPEHPK3PXP
Bank:gezd gnbv gy3t qojq;SHA256,8
Token:JBSWY3DPEHPK3PXP;,,60
Other:JBSWY3DPEHPK3PXP;SHA512,7,45
Empty lines and lines starting with # are ignored.
When you create, change or delete an entry in the program, only that
one line of the file is touched. Comments, blank lines and everything
else stay exactly as they are. The new file is written to a temporary
file with the extension .$$$ in the same directory, which then
replaces the original.
Every entry remembers a checksum of its line. If the file was changed
by another program after it was loaded, the program refuses to
overwrite it and asks you to press F5 first, so that a wrong line is
never replaced.
Master password and encrypted secrets
-------------------------------------
Choose File > Password, type a master password twice, and all entries
are encrypted in one step. From then on the program asks for the
password at startup. Cancel in that dialog ends the program. A new or
changed entry is encrypted automatically. Choosing File > Password
again changes the password.
The password can be up to 63 characters long. Deriving the key takes
a moment (the mouse pointer shows a clock).
What the file looks like afterwards:
#KDF 100000 KFD5UMCMCIHNXSLPGBW2NN5PFE
GitHub:$NIW6S5KF47UOXTW7AMYTLG7HI4GDHHLKEWLA
Bank:$6TWU4P5DUGMPZ62YYQOC4AORKKNAF2EMTISQ;SHA256,8
* The #KDF line holds the iteration count and the salt (base32).
A file without this line is not encrypted and is read as usual.
* Only the secret is encrypted. It is stored as $ followed by the
base32 text of a 12 byte nonce and the encrypted key. Names,
algorithm, digits and interval stay readable.
* The key is derived from the password with PBKDF2-HMAC-SHA256
(random salt, 100000 iterations for a new password). The secrets
are encrypted with ChaCha20 (RFC 8439). Every time an entry is
written it gets a new nonce.
* Plain entries in an encrypted file are still accepted. They are
encrypted when you change them or set the password again.
* The iteration count of a new password is KDF_ITER in the source.
On a slow machine you may want a smaller value; an existing file
keeps the count stored in its #KDF line.
Please note:
* THERE IS NO CHECK OF THE PASSWORD. This is deliberate: the file
then gives nobody a way to test password guesses against it. The
price is that a wrong password is not noticed, it just produces
wrong codes. If the codes do not match the service, close the
program and start it again with the right password. Do not
create or change entries while the codes are wrong: they would be
written under the wrong key.
* If you forget the password, the secrets can not be recovered.
Keep the recovery codes and the original secrets of your services
in a safe place, and keep a backup copy of TOTP.TXT.
* The encryption protects the file, for example a stolen copy or
a backup. It does not protect against someone who can use the
running program, against key loggers or other malware, or against
reading the memory of the running program. The password is
wiped from the program's own buffers after use, but the derived
key and the decrypted secrets must stay in memory while the
program runs.
* ChaCha20 hides the secrets but does not detect changes. Someone
who can write to the file can damage entries.
* There is no menu item to remove the encryption again.
* Try the encryption on a copy of your file first.
Limits
------
* 100 entries. Further lines are neither shown nor encrypted.
* Names up to 47 characters, secrets up to 64 bytes (103 base32
characters), lines up to 511 characters.
* The temporary file name is the file name with the extension .$$$,
so that it works on FAT as well.
Building
--------
The program is one C source file, C90, no resource file needed.
With Open Watcom (tested with version 1.1):
wcl386 -bt=os2 -l=os2v2_pm -w4 pmtotp.c
License and credits
-------------------
Copyright (c) 2026 Axel Meiss
Written by Claude (Anthropic). Compiled, tested and published by
Axel Meiss.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
hobbesgram.org/download/os2/util-12/encrypt-2/PMTOTP_2026-11-28.ZIP |
local copy
|
|
| TOTP for OS/2 Presentation Manager v. 1.0 (8/11/2026, Axel Meiss) | Readme/What's new |
TOTP for OS/2 Presentation Manager
==================================
A small Presentation Manager program that shows time-based one-time
passwords (TOTP, RFC 6238) - the codes that authenticator apps on
smartphones show. The secrets are kept in a plain text file.
Algorithms: SHA-1, SHA-256, SHA-512 (RFC 2104, RFC 4226, RFC 6238).
Usage
-----
pmtotp.exe [file]
The program reads the entries from TOTP.TXT in the current directory, or
from the file named on the command line. Each entry is shown with its
name, its current code and a bar below it that counts down the remaining
validity. The bar and the code turn red during the last sixth of the
period. Press F5 to read the file again after you have edited it.
The entries file
----------------
One entry per line:
Name:SECRET
Name:SECRET;ALGORITHM,DIGITS,PERIOD
SECRET is the base32 secret that the service displays when you set up
two-factor authentication. Upper or lower case, blanks, dashes and
trailing "=" are accepted; any length is fine.
The options after the semicolon are optional and positional. An empty
field keeps its default:
ALGORITHM SHA1 (default), SHA256 or SHA512
DIGITS 6 (default), 7 or 8
PERIOD seconds, 1 to 86400, default 30
Most services use the defaults. Use the options only if the service says
otherwise.
Example:
# lines starting with # and empty lines are ignored
GitHub:JBSWY3DPEHPK3PXP
Bank:gezd gnbv gy3t qojq;SHA256,8
Token:JBSWY3DPEHPK3PXP;,,60
Other:JBSWY3DPEHPK3PXP;SHA512,7,45
The name may contain colons; the secret is the text after the last
colon. Lines that cannot be read are skipped, and their number is shown
in red at the bottom of the window.
Important
---------
* The codes are calculated from UTC, which the program derives from the
system clock and the TZ variable. If the clock is wrong or TZ in
CONFIG.SYS does not match your time zone, every code will be wrong.
The clock must be accurate to within a few seconds.
* The secrets are stored unencrypted in the entries file. Protect the
file like a password list, and do not share it.
* Limits: 64 entries, names up to 47 characters, secrets up to 64 bytes.
There is no scrolling; enlarge the window if entries are cut off.
There are no menus - edit the file with a text editor, then press F5.
Building from source
--------------------
wcl386 -bt=os2 -l=os2v2_pm -w4 pmtotp.c
Needs Open Watcom with the OS/2 headers. Single source file, no resources.
License
-------
MIT License
Copyright (c) 2026 Axel Meiss
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Credits
-------
Written with Claude (Anthropic). Compiled, tested and published by
Axel Meiss.
|
hobbesgram.org/download/os2/util-12/encrypt-2/PMTOTP.ZIP |
local copy
|
|
| TOTP & TOTP for OS/2 Presentation Manager (14/5/2025, Axel Meiss) | ||
www.hobbesarchive.com/Hobbes/pub/os2/util/encrypt/TOTP_2025-05-14.ZIP |
local copy
|
|
| TOTP & TOTP for OS/2 Presentation Manager (13/5/2025, Axel Meiss) | Readme/What's new |
TOTP.EXE
(MD5 7b31ebb4505ad3d5d6398997e1cc8036)
(SHA-1 26e77cfaa8f5c25d99038fe3fcfda7d1ccb89d19)
Copyright (c) 2025 Axel Meiss
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Introduction
Today, Two-Factor-Authentication (2FA) is a common way of authentication of a user to a system. Usually, the standard method of authentication is the login by supplying a login-id (user name) and a password. In the past decades it has become obvious that this method alone may not be sufficient anymore to protect systems from unauthorized access. So, engineers have devised a strategy to overcome this problem by adding another method of authentication. A good way to do this is to create a temporary code which will be given to the user. This temporary code will only be valid for seconds or minutes and which has to be entered by user. This temporary code shall be called One-Time Password (OTP). Preferably, this code will be submitted to the user to a separate device. A widely used method is sending the user an SMS which holds the temporary code. Many users have already encountered this procedure. A different way of creating a temporary code is letting a device _calculate_ a valid OTP. Based on a secret that both the system and the user hold, an OTP is created using cryptographic functions which should make it highly improbable for eaves-dropper to predict OTPs without having the secret. Engineers have come up with a solution using time as the base of the calculation and called the baby "Time-based One-Time Password" (TOTP). Calculating the TOTP is actually what the attached program does.
For smartphones there are plenty of apps which perform this calculation, notably the Google Authenticator. There are also TOTP-generators online available. For me, it was a programming task which I wanted to complete, having a stand-alone application on my computer. Actually, the OS/2 version is a byproduct.
Description
The TOTP program is a command line utility that creates Time-based One-Time Passwords based on the computer's clock and a secret. The secret is a base32-string which will be internally converted to binary data. The algorithm is derived from the following RFC:
RFC 2104 HMAC: Keyed-Hashing for Message Authentication
RFC 4226 HOTP: An HMAC-Based One-Time Password Algorithm
RFC 6238 TOTP: Time-Based One-Time Password Algorithm
The program loops indefinitely and should be stopped using <Ctrl-C>
Syntax
totp.exe <time interval in seconds> <count of displayed digits> <base32-string>
<time interval> between 1 and 60. RFC6238 defaults to 30 seconds
<count of displayed digits> between 6 and 10. Defaults to 6 digits
<base32-string> string consisting only of characters A-Z and the digit characters 2-9 (0 and 1 are omitted)
this string should have a length of a multiple of 8 (8,16,24,32,40...) otherwise it will produce invalid codes
Remarks
After having created the TOTP-generator for my internal use I was wondering if there was an OS/2 TOTP-generator. I could not find one on hobbesarchive.com (Thanks for supplying and maintening this archive!). That is why I created the OS/2 version of it to let OS/2 users have a native TOTP-generator.
This program has been compiled using OpenWatcom 1.9 on an eComStation 1.2 installation in VirtualBox. So, it should be executable on any system based on OS/2 4.52. I haven't tested it on previous versions but it may be as well executable on OS/2 3.0.
Source code is not supplied because there are plenty of sources on Github or www.rosettacode.org. I did not use any of them. Instead, I encourage programmers to create their own version of a TOTP-generator because I think it is an interesting and rewarding programming task.
TOTP may use different hashing algorithms, proposed are SHA-1, SHA-256, SHA-512. I only implemented SHA-1 which is most widely used.
The program is free of charge but if you like the program or if you use it regularly you may donate the amount of $1 or EUR 1 via PayPal
to this email address:
jungfernschreiber@gmail.com
Thanks for using OS/2
Axel
|
www.hobbesarchive.com/Hobbes/pub/os2/util/encrypt/TOTP_2025-05-13.ZIP |
local copy
|

This work is licensed under a Creative Commons Attribution 4.0 International License.
Add new comment