View on GitHub

keepass2android

Password manager app for Android

TOTP in brief

TOTP stands for Time-based One-Time Password algorithm which is one of the most common way proposed by websites to do a two-factor authentication (2FA).

On these websites, this option will often be mentioned in the 2FA configuration menu as things like “use code generated by an application”, “use [Google] Authenticator app”.

You’re prompted to scan a QR code with the app, which essentially contains a code called “seed”, usually with a form like “AZER TYUI OPQS DFGH JKLM”, used to generate TOTPs. The seed can be also directly copied if there is no scanning option on the app.

Most common apps:

TOTP in KeePass and benefits

In KeePass (by Dominik Reichl) there is are several ways to enable this Authenticator app ability:

KeePassXC also supports TOTP: https://keepassxc.org/docs/KeePassXC_UserGuide#_adding_totp_to_an_entry

The greatest benefits are:

The different implementations use different ways of storing the TOTP seed (or secret, or key) and optional settings (e.g. the length of the TOTP to generate) within an entry inside the kdbx database. Keepass2Android attempts to be able to read the different formats, but can only write one:

TOTP in Keepass2Android

If you use any of the tools mentioned above, you can set up TOTP entries with them. Keepass2Android can read those entries and generate TOTPs if any of the following styles are used:

In order to view the generated TOTP code in KP2A, open the corresponding entry. You can then

If you want to configure an entry to contain the TOTP fields, it is suggested to enter edit mode for the entry. Then click the “Configure TOTP” button. You can either enter the data manually or scan a QR code with the information.

Spaces in otp field

Make sure that the URI doesn’t contain spaces, otherwise KeePass2Android will fail to generate TOTPs as a space is an invalid character. If your URIs have spaces, check this comment._