frankosterfeld/qtkeychain

Platform-independent Qt API for storing passwords securely.

504

stars

465

commits

C++

primary language

Sep 11, 2026

updated

README

QtKeychain

QtKeychain is a Qt API to store passwords and other secret data securely. How the data is stored depends on the platform:

  • macOS: Passwords are stored in the macOS Keychain.

  • Linux/Unix: If running, GNOME Keyring is used, otherwise QtKeychain tries to use KWallet (via D-Bus), if available. Libsecret (common API for desktop-specific solutions) is also supported.

  • WebAssembly: Passwords are managed using a transient HTML bridge form, enabling the browser's native password manager (auto-fill and "Save Password" prompts) and the Credential Management API (navigator.credentials).

  • Windows: By default, the Windows Credential Store is used (requires Windows 7 or newer). Pass -DUSE_CREDENTIAL_STORE=OFF to cmake to disable it. If disabled, QtKeychain uses the Windows API function CryptProtectData to encrypt the password with the user's logon credentials. The encrypted data is then persisted via QSettings.

  • Android and iOS: Passwords are stored in the Android keystore system and iOS keychain, respectively.

In unsupported environments QtKeychain will report an error. It will not store any data unencrypted unless explicitly requested (setInsecureFallback( true )).

Requirements

QtKeychain 0.12 and newer supports Qt 5 and Qt 6 and requires a compiler with C++11 support. Older versions support Qt 4 and Qt 5.

License

QtKeychain is available under the Modified BSD License. See the file COPYING for details.

Contributors

(top 30 of 69)

frankosterfeld

244 commits

akallabeth

17 commits

claucambra

14 commits

TheOneRing

14 commits

frankosterfeld/qtkeychain

Platform-independent Qt API for storing passwords securely.

504

stars

465

commits

C++

primary language

Sep 11, 2026

updated

README

QtKeychain

QtKeychain is a Qt API to store passwords and other secret data securely. How the data is stored depends on the platform:

  • macOS: Passwords are stored in the macOS Keychain.

  • Linux/Unix: If running, GNOME Keyring is used, otherwise QtKeychain tries to use KWallet (via D-Bus), if available. Libsecret (common API for desktop-specific solutions) is also supported.

  • WebAssembly: Passwords are managed using a transient HTML bridge form, enabling the browser's native password manager (auto-fill and "Save Password" prompts) and the Credential Management API (navigator.credentials).

  • Windows: By default, the Windows Credential Store is used (requires Windows 7 or newer). Pass -DUSE_CREDENTIAL_STORE=OFF to cmake to disable it. If disabled, QtKeychain uses the Windows API function CryptProtectData to encrypt the password with the user's logon credentials. The encrypted data is then persisted via QSettings.

  • Android and iOS: Passwords are stored in the Android keystore system and iOS keychain, respectively.

In unsupported environments QtKeychain will report an error. It will not store any data unencrypted unless explicitly requested (setInsecureFallback( true )).

Requirements

QtKeychain 0.12 and newer supports Qt 5 and Qt 6 and requires a compiler with C++11 support. Older versions support Qt 4 and Qt 5.

License

QtKeychain is available under the Modified BSD License. See the file COPYING for details.

Contributors

(top 30 of 69)

frankosterfeld

244 commits

akallabeth

17 commits

claucambra

14 commits

TheOneRing

14 commits

Languages

C++

65.5%

CMake

26.0%

Objective-C++

5.2%

QMake

1.7%

QML

1.7%