Skip to content

App lock and the vault

The lock screen says why it locked (Locked: screen locked., Locked: no keyboard or mouse input for 15 min., The session ended.) and shows errors in red under the button. Settings are in Settings → Security & Privacy → App Lock: Unlock lasts (default 60 min), Lock after inactivity, Lock on sleep, closed lid, display sleep and screen lock, and Two-Factor Unlock. Locking clears the secrets and the keys decrypted by the built-in SSH agent from memory; open connections keep running. Setting the lock up: Set up the app lock.

KryoDesk asks macOS for owner authentication (LAPolicyDeviceOwnerAuthentication): Touch ID, a paired Apple Watch, or the macOS account password when neither is available (lid closed with an external keyboard, no fingers enrolled, sensor failure). The system sheet then asks for the password. There is no state in which Touch ID alone is required. Setting up Touch ID, the Magic Keyboard sensor and Apple Watch: Set up the app lock.

Errors under Unlock (and under the Touch ID tile at the first start) have one of these forms; <text> is the description macOS gives in the system language:

Message Meaning
authentication failed: com.apple.LocalAuthentication <code>: <text> The sheet was shown and ended without success. The code says why (table below).
authentication unavailable: com.apple.LocalAuthentication <code>: <text> macOS refused to show the sheet at all.
authentication reply never arrived LocalAuthentication ended without an answer. Click Unlock again; if it repeats, restart KryoDesk.
the app locked again during authentication (sleep or screen lock) The Mac slept or the screen locked while the sheet was open. Start again.
Touch ID, Apple Watch or the macOS password: … / touch-id is not available (…): the app could not be unlocked with it An action that confirms it is you (accepting an older vault.kdbx, turning the system step back on) could not ask macOS; the reason in brackets is the same com.apple.LocalAuthentication <code> text.

The first-start screen also shows, on a Mac without Touch ID and a paired watch, Mr. Paperclip’s note macOS says: no Touch ID / Apple Watch: com.apple.LocalAuthentication <code>: <text>. The Touch ID tile works anyway: it asks for the account password. That is not an error: the code tells why the fingerprint is not offered.

<code> is a value of macOS’ LAError:

Code Name Typical cause What to do
-1 authenticationFailed Wrong password or fingerprint several times in the sheet. Click Unlock again.
-2 userCancel Cancel in the sheet, or Esc. Click Unlock again.
-4 systemCancel macOS closed the sheet: another app came to the front, the screen saver started, a Screen Sharing session took over the screen. Bring KryoDesk to the front and click Unlock.
-5 passcodeNotSet The macOS account has no password. Owner authentication needs one. System Settings → Users & Groups: set a password for the account, or choose Authenticator app as the method.
-6 biometryNotAvailable No sensor (Mac without Touch ID, Magic Keyboard with Touch ID not connected), or biometrics turned off by a configuration profile (bioutil -r -s shows the system settings). The sheet asks for the password. For the fingerprint: connect the keyboard, or ask the Mac’s administrator about the profile.
-7 biometryNotEnrolled No fingerprint enrolled for this account. System Settings → Touch ID & Password → Add Fingerprint; bioutil -c shows the count.
-8 biometryLockout 5 unrecognised fingers in a row: macOS locked Touch ID until the password is typed. Type the macOS password in the sheet; Touch ID works again after it.
-9 appCancel KryoDesk closed the sheet (the app locked, quit, or another unlock started). Start the unlock again.
-11 biometryNotPaired A Magic Keyboard with Touch ID was never paired with this Mac. Connect it once with the cable; see the guide.
-12 biometryDisconnected The keyboard with the sensor is off, out of range, or the lid is closed and the only sensor is the built-in one. Turn the keyboard on, open the lid, or type the password.
-14 companionNotAvailable No paired Apple Watch near the Mac (shown only in the note above). Wear and unlock the watch; check System Settings → Touch ID & Password → Apple Watch.
-1004 notInteractive macOS could not show the sheet (no session on the display, for example a login over SSH only). Unlock at the Mac or over Screen Sharing.

With the lid closed the built-in sensor does not read and the sheet offers the Apple Watch or the password; this is expected. A closed lid is also reported by macOS as display sleep, so with Lock on sleep, closed lid, display sleep and screen lock on, the lock screen says Locked: display sleep / lid closed. A Magic Keyboard with Touch ID gives the fingerprint back in this setup.

The sheet comes up on the Mac’s screen and is visible over the remote session. Touch ID and the watch need someone at the Mac; type the macOS password in the sheet. The lock screen does not offer a separate remote unlock.

macOS shows its prompt: "KryoDesk" wants to use your confidential information stored in "pl.kryodesk" in your keychain.

The vault key is the Keychain item vault-key (service pl.kryodesk). Its access list allows the KryoDesk build that created it; the Keychain asks when another build reads it: after an update, a build of your own, or a copy of the app from elsewhere.

  • Always Allow (login password): the new build is added to the list; the prompt does not come back until the next update.
  • Deny: the unlock stops with cannot read item vault-key from the macOS Keychain: Platform secure storage failure: <text>. Click Unlock again and allow.

Other texts after Platform secure storage failure: come from the Keychain (SecCopyErrorMessageString):

Text (example) Cause What to do
User canceled the operation. (errSecUserCanceled, -128) Deny or Esc in the Keychain prompt. Unlock again and allow.
User interaction is not allowed. (errSecInteractionNotAllowed, -25308) The login keychain is locked and macOS cannot ask (screen locked, SSH-only session). Unlock the Mac, or security unlock-keychain ~/Library/Keychains/login.keychain-db.
The user name or passphrase you entered is not correct. (errSecAuthFailed, -25293) Wrong login password in the prompt, or the login keychain’s password differs from the account password after a password reset. Type the old password; or Keychain Access → Edit → Change Password for Keychain “login”.

Couldn't access platform secure storage: … means the keychain itself is not available (errSecNoSuchKeychain, errSecNotAvailable): check that ~/Library/Keychains/login.keychain-db exists and is the default keychain (security default-keychain).

The Keychain item vault-key stays on the Mac that created it; iCloud Keychain does not sync it. A copied pl.kryodesk folder on a new Mac gives … exists, but its key (item vault-key in the macOS Keychain) is missing. Move the item with the folder. On the old Mac security find-generic-password -s pl.kryodesk -a vault-key -w prints its value (JSON with the vault key: anyone with it and vault.kdbx can open the vault); on the new one security add-generic-password -s pl.kryodesk -a vault-key -w '<value>' creates it, and the first unlock asks for Always Allow. Copy vault.kdbx and vault.kdbx.created together. A Migration Assistant or Time Machine transfer of the whole user account moves the login keychain with the item.

KryoDesk asks Windows whether Windows Hello can verify you (UserConsentVerifier) before it shows the Windows Hello prompt. When Windows answers that there is nothing to verify with, no prompt is shown:

  • No unlock method chosen yet (first start, or saved secrets from a build without the lock): the method screen opens with the Windows Hello tile greyed out and its reason. Clicking it opens the helper: the cause, Open sign-in options, Check again. Once Windows Hello works, the helper goes straight to the Windows Hello prompt. The Authenticator app tile works without Windows Hello: see Unlock method never chosen.
  • Windows Hello chosen as the method: the lock screen shows the reason, Open sign-in options and Check again. When the vault key is sealed with a Windows Hello key that is gone, see Reset saved secrets.

The tile shows the short reason; the helper and the lock screen show the full text with the Windows status name.

Tile Full text Cause What to do
No Windows Hello: no PIN, camera or fingerprint reader no Windows Hello device (camera, fingerprint reader) and no PIN (DeviceNotPresent) No PIN and no Windows Hello camera or reader. Also a virtual machine without them, and a Remote Desktop session. Set up a Windows Hello PIN; in a VM see Virtual machines and TPM; over Remote Desktop see Remote Desktop.
No Windows Hello: no PIN set up not set up for this user: Settings → Accounts → Sign-in options (NotConfiguredForUser) The device is there, but this Windows account has no PIN, face or fingerprint. Set up a Windows Hello PIN.
Windows Hello turned off by policy turned off by group policy (DisabledByPolicy) A group policy (domain, Intune, local) turns Windows Hello off. Group policy; or the authenticator app.
Windows Hello is busy the device is busy with another request (DeviceBusy) Another Windows Hello prompt is open (another app, the sign-in screen). Close it, then Check again.
Windows Hello not available UserConsentVerifierAvailability <n> A status this KryoDesk version does not know. Check again; report the number.
Windows Hello check failed UserConsentVerifier.CheckAvailabilityAsync failed: HRESULT 0x…: … The Windows call failed. Check again; the HRESULT names the cause.
Windows Hello is not available over Remote Desktop <one of the texts above> in a Remote Desktop session (GetSystemMetrics(SM_REMOTESESSION) != 0): unlock at the computer itself KryoDesk runs in a Remote Desktop session. Remote Desktop.

After the prompt, a failed check reads authentication failed: Windows Hello: UserConsentVerificationResult <n> <text>:

<n> <text> Cause What to do
6 canceled by user The prompt was cancelled. Unlock again.
5 too many failed attempts Wrong PIN, face or fingerprint too many times. Wait, or sign out of Windows and in again; then Unlock.
1 no Windows Hello device The device went away after the check (USB reader unplugged, Remote Desktop). As DeviceNotPresent above.
2 not set up for this user (Settings → Accounts → Sign-in options) The PIN was removed. Set up a Windows Hello PIN.
3 turned off by group policy Policy changed meanwhile. Group policy.
4 the device is busy Another prompt is open. Close it, Unlock again.

The vault key sealed with Windows Hello (Windows Hello chosen as the method) is opened by KryoDesk’s own Windows Hello key:

Message Cause What to do
Windows Hello did not sign: KeyCredential.RequestSignAsync: KeyCredentialStatus 3 canceled by user The prompt was cancelled. Unlock again.
… KeyCredentialStatus 6 the security device (TPM) is locked after failed attempts The TPM locked itself after wrong PINs. Wait (the TPM lockout lasts from minutes to hours), or reset the lockout in tpm.msc as administrator.
the vault key cannot be opened on this computer: its Windows Hello key no longer exists: … KeyCredentialStatus 2 the vault's Hello key is gone (Hello reset or another Windows account): the vault cannot be opened with Windows Hello The PIN was removed or reset, the Windows Hello container or the TPM was cleared, or this is another Windows account. Reset saved secrets.
Windows Hello keys are not available (KeyCredentialManager.IsSupportedAsync = false): set up a PIN in Settings → Accounts → Sign-in options Windows Hello verifies you but cannot keep keys (no PIN). Set up a Windows Hello PIN.
the vault key is sealed with Windows Hello: it opens on Windows only The configuration folder was copied from Windows to a Mac. Use it on that Windows computer.

Other Windows calls name the call and its HRESULT, for example Windows Hello request failed: HRESULT 0x…: ….

  1. Open sign-in options in KryoDesk, or Settings (WinI) → Accounts → Sign-in options.
  2. PIN (Windows Hello) → Set up. Windows asks for the account password (a Microsoft account: its password; a local account without a password: set one first in Password).
  3. Enter the new PIN twice → OK. Face or fingerprint (Facial recognition, Fingerprint recognition) can be added after the PIN.
  4. Back in KryoDesk: Check again. The tile (or the lock screen) shows Windows Hello as available and asks for it.

A virtual machine usually has no camera or fingerprint reader, so only the PIN is left. Windows keeps the PIN key in the TPM when there is one. Windows 11 requires a TPM; a policy that requires a hardware security device (Windows Hello for Business) refuses a PIN without one.

  • Hyper-V (generation 2): VM Settings → Security → Enable Trusted Platform Module.
  • VMware Workstation / Fusion: add a Trusted Platform Module device (the VM must be encrypted).
  • VirtualBox 7: Settings → System → TPM: v2.0.
  • Parallels: Configure → Hardware → + → TPM Chip.

Check in the VM: tpm.msc shows The TPM is ready for use, or in PowerShell as administrator Get-Tpm shows TpmPresent : True and TpmReady : True. Then set up the PIN.

Windows does not pass Windows Hello of the computer you connect from into a Remote Desktop session: in the session Windows Hello reports as unavailable (usually DeviceNotPresent), even when it is set up on the remote computer. KryoDesk recognizes the session (GetSystemMetrics(SM_REMOTESESSION)) and shows Windows Hello is not available over Remote Desktop. Unlock KryoDesk at that computer (or its VM console). In a Remote Desktop session KryoDesk does not offer to change the unlock method of saved secrets nor to reset them: Windows Hello may work at the console. A first start (no saved secrets) can still pick the authenticator app.

DisabledByPolicy comes from a policy of your organization or a local one. Check:

  • Settings → Accounts → Sign-in options says Some of these settings are managed by your organization.
  • gpresult /h "%TEMP%\gp.html" and open the file: look for Turn on convenience PIN sign-in (Computer Configuration → Administrative Templates → System → Logon) and the policies under Windows Components → Windows Hello for Business.
  • Intune or another MDM: the Identity protection / Windows Hello for Business profile.

Changing them is up to the administrator. Without Windows Hello the unlock method is the authenticator app.

A vault saved by a build without the lock (a debug build, or before KryoDesk asked for a method) has no unlock method; KryoDesk then asks for the system’s own method. When Windows Hello is missing, the method screen opens instead of an error, with the saved secrets kept:

  1. Authenticator app → scan the QR code with Microsoft or Google Authenticator, 1Password, Bitwarden or another TOTP app (or type the secret).
  2. Enter the 6-digit code → Confirm. This unlocks the app; the authenticator app is from now on the only unlock step.
  3. Save the 10 recovery codes shown once → I saved them, continue.

KryoDesk offers this only when Windows itself reports that Windows Hello is not there (DeviceNotPresent, NotConfiguredForUser, DisabledByPolicy, not in a Remote Desktop session), the vault key item says no method and holds the key itself (not sealed with Windows Hello), and the vault has secrets but no method and no authenticator code. On a computer where Windows Hello works the method screen does not appear: unlock with Windows Hello, then change the method in Settings → Security & Privacy → App Lock. In such a vault the key in Credential Manager is not sealed, so any program running as your Windows user can read it: the Windows Hello step only guarded the app, and the authenticator code guards it the same way.

To use Windows Hello later: set up the PIN, then Settings → Security & Privacy → App Lock.

When the vault key is sealed with a Windows Hello key that is gone (an unlock got KeyCredentialStatus 2, or Windows Hello is not there and Windows reports the key as not found), the lock screen shows the reason and Reset saved secrets…. While the key still exists (Windows Hello unavailable only in this session, Remote Desktop) the reset is refused: the Windows Hello key of the vault key exists; Windows Hello is unavailable in this session (…): unlock at the computer's console (Remote Desktop?) (reset refused). Neither the authenticator code nor the recovery codes open the vault: they are stored inside it.

Before resetting:

  • Set Windows Hello up again on the same Windows account and Check again: a removed PIN usually deletes the key, but a busy or turned-off device does not.
  • A KeePass export made earlier (Import/Export → KeePass) can be imported after the reset.

Reset saved secrets… → type reset → Reset saved secrets. With Windows Hello available it asks for Windows Hello first. Nothing is deleted:

Was Kept as
%APPDATA%\pl.kryodesk\vault.kdbx vault.kdbx.lost-<unix time>
vault.kdbx.created vault.kdbx.created.lost-<unix time>
vault-key in Credential Manager vault-key-lost-<unix time>
the old vault item (if still there) vault-lost-<unix time>: the secrets as they were when moved into vault.kdbx, not encrypted; deleted at the first unlock 30 days after the reset (listed in vault-lost.json next to vault.kdbx); until then any program running as your Windows user can read it

Then the method screen starts an empty vault; sessions in sessions.json stay, passwords must be entered again. Pan Spinacz lists what was kept where. The kept file opens only with the Windows Hello key it was sealed with: put the file back as vault.kdbx and the item back as vault-key if that key comes back.

Message Cause and fix
wrong code (attempt N of 5). This computer's clock: hh:mm:ss UTC; codes from 30 s before to 30 s after it are accepted, so a phone clock off by more gives wrong codes. A recovery code works once. Compare the printed UTC time with the phone’s. Both should take the time from the network (sntp -t 1 time.apple.com on the Mac shows the offset).
this code was already used; wait N s for the next one Each code unlocks once; wait for the next one in the app.
5 wrong codes in a row: the app locked; authenticate again with Touch ID, Apple Watch or the macOS password After 5 wrong codes the first step is needed again.
5 wrong codes in a row: the app locked; next try in N s and Too many wrong codes: next try in N s. With the code as the only unlock step, each series of 5 wrong codes waits longer: 30 s, then doubling up to 1 hour.
the first factor expired (5 min without a code): start the unlock again The code was not entered within 5 minutes of Touch ID.
enter the 6 digits from the authenticator app or a recovery code (XXXXX-XXXXX) The input is neither. Spaces and - in a 6-digit code are ignored.
the app locked again (sleep or screen lock): start the unlock again The computer slept or the screen locked between the first step and the code.
the code does not match the new secret. This computer's clock: hh:mm:ss UTC (±30 s accepted); check the time on the phone and that the code is from the newly added KryoDesk entry Setup: the clock differs, or the code is from an older KryoDesk entry in the app (each setup makes a new secret).
the QR code expired (15 min): start the setup again Setup: the code was not confirmed within 15 minutes.
two-factor unlock is not set up (turned off in another window or app instance?) Another KryoDesk window or instance turned it off meanwhile.

Clock check: macOS System Settings → General → Date & Time → Set time and date automatically, sntp -t 1 time.apple.com prints the offset. Windows Settings → Time & language → Date & time → Sync now, w32tm /stripchart /computer:time.windows.com /samples:1. On the phone, the automatic date and time of the system; Google Authenticator also has Settings → Time correction for codes.

  1. On the lock screen enter one of the 10 recovery codes shown when two-factor unlock was set up (XXXXX-XXXXX, any case). Each works once; Pan Spinacz says how many are left.
  2. In Settings → Security & Privacy → App Lock → Two-Factor Unlock, type another recovery code into the field and click Turn off (with the code as the only step: Use Touch ID / the macOS password first, then Turn off).
  3. Set up authenticator… with the new phone. New recovery codes are shown once; save them.

Without the authenticator and without a recovery code the app cannot be unlocked: there is no reset of the second factor from the lock screen. New recovery codes (same page, needs a current code) replaces all old ones.

Secrets are in vault.kdbx; its key is the item vault-key in the system key store:

vault.kdbx Key
macOS ~/Library/Application Support/pl.kryodesk/vault.kdbx macOS Keychain, service pl.kryodesk, item vault-key
Windows %APPDATA%\pl.kryodesk\vault.kdbx Windows Credential Manager, generic credential vault-key.pl.kryodesk

Messages name the store of the system (the macOS Keychain or the Windows Credential Manager). See Where sessions and secrets are stored.

…/vault.kdbx (first saved <date>) is missing: restore the file from a backup …

Section titled “…/vault.kdbx (first saved <date>) is missing: restore the file from a backup …”
  • Cause: the file was deleted or moved (a restore without it, a cleanup tool), while KryoDesk had saved one before (its marker file or the Keychain item says so).
  • Fix: put the file back from a backup (Time Machine, File History) at the printed path; it opens with the existing vault-key. Otherwise the lock screen offers Restore from the old copy… (when the older Keychain item vault still exists) or Start with an empty vault…; both need a second click and drop everything saved in the missing file. Saved sessions in sessions.json stay; only passwords and other secrets are lost.

…/vault.kdbx is not the file KryoDesk saved last (SHA-256 …, expected …): an older copy was put back …

Section titled “…/vault.kdbx is not the file KryoDesk saved last (SHA-256 …, expected …): an older copy was put back …”
  • Cause: the file on disk is not the last one KryoDesk wrote: a backup was restored, or the file was changed outside KryoDesk. KryoDesk refuses it so that an older file cannot undo a two-factor setup or a used recovery code.
  • Fix: put the newest file back; or Use this file anyway… on the lock screen (second click: Use this file (changes saved after it are lost)).

…/vault.kdbx exists, but its key (item vault-key in the macOS Keychain) is missing: the vault cannot be opened without it.

Section titled “…/vault.kdbx exists, but its key (item vault-key in the macOS Keychain) is missing: the vault cannot be opened without it.”
  • Cause: the item was deleted (Keychain Access or Credential Manager, a Keychain reset, a new computer without the keychain or the Windows profile). On Windows the message names the Windows Credential Manager.
  • Check: macOS: security find-generic-password -s pl.kryodesk -a vault-key prints the item’s attributes (not the key) if it exists. Windows: cmdkey /list:vault-key.pl.kryodesk.
  • Fix: restore the item (a Keychain backup, or an item vault-key-lost-<time> that KryoDesk kept when a key was replaced). To give the vault up, move vault.kdbx out of the folder; the lock screen then offers to start again.

KryoDesk never creates a new vault in place of an existing file or a missing one by itself.

When KryoDesk replaces the key item (start again after a lost file, a new setup over an unreadable item), it keeps the old one as vault-key-lost-<unix seconds> in the same store. To open a vault.kdbx from before that, make it vault-key again. macOS: Keychain Access, search pl.kryodesk; the Account column shows vault-key and vault-key-lost-<time>. Then, with the time of the item you need:

Terminal window
security find-generic-password -s pl.kryodesk -a vault-key-lost-1796000000 -w > /tmp/k # its value
security delete-generic-password -s pl.kryodesk -a vault-key # only if the current key is not needed
security add-generic-password -s pl.kryodesk -a vault-key -w "$(cat /tmp/k)" && rm -P /tmp/k

Quit KryoDesk first. The value is the vault key: keep it out of shell history and shared folders. The first unlock then asks the Keychain prompt (Always Allow). On Windows the items are generic credentials vault-key-lost-<time>.pl.kryodesk in Credential Manager; with Windows Hello the key in them is sealed with the Windows Hello key of that time.

Next to vault.kdbx, a small JSON file: when the vault file was first saved, whether it came from the older Keychain item vault, and how many unlocks opened it since. It is what tells KryoDesk that a missing vault.kdbx was lost rather than never made, and it counts down the removal of the older item (after 5 unlocks and 7 days, only when it is unchanged). Restore it together with vault.kdbx; do not delete it to “reset” the vault: without the file and the marker the Keychain still holds vault-moved, and the lock screen reports the vault as missing. …/vault.kdbx.created is not a vault marker (… error at line N, column M) = the file was edited or damaged: put it back from the same backup as vault.kdbx.

Message Cause What to do
cannot open …/vault.kdbx: KDBX: <error> (wrong key, damaged or replaced file) The key item does not open this file: another computer’s file, a key item from another vault, or a damaged file. Put back the matching pair (vault.kdbx + vault-key) from the same backup.
item vault-key in the macOS Keychain is not a vault key (… error at line N, column M) The item’s content is not KryoDesk’s JSON (edited by hand, another program used the name). Restore the item from a backup or a vault-key-lost-<time> item (above).
item vault-key in … has version N (this build reads M) The item was written by a newer KryoDesk. Install that version again.
the vault key is sealed with Windows Hello: it opens on Windows only The item came from a Windows computer. Open the vault on that computer.
Message Meaning
saved secrets are locked: unlock the app (…) An action needed a secret while the app was locked. The text in brackets names the unlock methods of the system.
the vault key (item vault-key in the macOS Keychain) was removed while the app was unlocked: nothing saved / … was replaced … Another program changed the Keychain item. Nothing was written to vault.kdbx.
the unlock method changed meanwhile …, … (another app instance) A second KryoDesk changed the setup at the same time. Start the unlock again.

Scroll or pinch to zoom · drag to move · double-click to zoom · Esc or click outside to close