mOTP is C based software for generate mOTP codes.
|
3 ay önce | |
---|---|---|
.github | 1 ay önce | |
3rdparty | 1 ay önce | |
src | 1 ay önce | |
.clang-format | 1 ay önce | |
.editorconfig | 1 ay önce | |
.gitignore | 3 ay önce | |
.gitmodules | 1 ay önce | |
LICENSE | 1 ay önce | |
motp.project | 1 ay önce | |
motp.workspace | 1 ay önce | |
readme.md | 1 ay önce |
Rozhuk Ivan rozhuk.im@gmail.com 2024-2025
mOTP is C based software for generate Mobile-OTP codes.
BSD licence.
Support the author
If you need to generate [] using the [
], from the command-line, without futzing around with your phone.
This is a self-proclaimed “standard” algorithm for one-time passwords. It is confusing, seemingly almost obsolete, and appears to mainly be used in German-speaking countries. You don't want to use this unless you are forced to interact with an existing system that uses such codes for 2FA.
The principle of the algorithm is []
and [
] but it's very simple: you have a token secret
(an ASCII string, usually hexadecimal or alphanumeric) and a PIN (an ASCII string, usually 4 digits), and this is converted to a 6-digit code using:
counter = ASCII((UNIX epoch time) / 10s)
digest = MD5HEX(counter || secret || pin)
code = LEFT(digest, 6 characters)
sudo apt-get install build-essential git fakeroot
git clone --recursive https://github.com/rozhuk-im/motp.git
cd motp/src
cc motp.c -O2 -I../3rdparty/liblcb/include/crypto/hash -lm -o motp
sudo pkg install git
git clone --recursive https://github.com/rozhuk-im/motp.git
cd motp/src
cc motp.c -O2 -I../3rdparty/liblcb/include/crypto/hash -lm -o motp
motp Simple console mOTP tool
Usage: motp [options]
options:
-help, -? Show help
-secret, -s <string> Shared secret
-pin, -p <string> PIN
-duration, -P seconds> Code duration interval. Default: 10
-length, -d <number> Result code length. Default: 6
-time, -t <string> Time string, in one of formats: HTTP date / RFC 822, RFC 850, ANSI C, YYYY-MM-DD HH:MM:SS, Number of seconds since the Epoch (UTC)
-tz, -T <string> The timezone time zone offset from UTC. Will override time zone from 'time' string is set. Ex: +0100, -0500.
motp -s 'secret' -p '1111'