{"record":{"id":"1b42e7ae1b6a8fd0","repo":"beemdevelopment/Aegis","slug":"password-incorrect","errorCode":null,"errorMessage":"Password incorrect","messagePattern":"Password incorrect","errorType":"exception","errorClass":"DatabaseImporterException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/com/beemdevelopment/aegis/importers/AegisImporter.java","lineNumber":96,"sourceCode":"            return new DecryptedState(obj, creds);\n        }\n\n        public State decrypt(char[] password) throws DatabaseImporterException {\n            List<PasswordSlot> slots = getSlots().findAll(PasswordSlot.class);\n            PasswordSlotDecryptTask.Result result = PasswordSlotDecryptTask.decrypt(slots, password);\n            VaultFileCredentials creds = new VaultFileCredentials(result.getKey(), getSlots());\n            return decrypt(creds);\n        }\n\n        @Override\n        public void decrypt(Context context, DecryptListener listener) {\n            Dialogs.showPasswordInputDialog(context, R.string.enter_password_aegis_title, 0, (Dialogs.TextInputListener) password -> {\n                List<PasswordSlot> slots = getSlots().findAll(PasswordSlot.class);\n                PasswordSlotDecryptTask.Params params = new PasswordSlotDecryptTask.Params(slots, password);\n                PasswordSlotDecryptTask task = new PasswordSlotDecryptTask(context, result -> {\n                    try {\n                        if (result == null) {\n                            throw new DatabaseImporterException(\"Password incorrect\");\n                        }\n\n                        VaultFileCredentials creds = new VaultFileCredentials(result.getKey(), getSlots());\n                        State state = decrypt(creds);\n                        listener.onStateDecrypted(state);\n                    } catch (DatabaseImporterException e) {\n                        listener.onError(e);\n                    }\n                });\n\n                Lifecycle lifecycle = ContextHelper.getLifecycle(context);\n                task.execute(lifecycle, params);\n            }, (DialogInterface.OnCancelListener) dialog -> listener.onCanceled());\n        }\n    }\n\n    public static class DecryptedState extends State {\n        private JSONObject _obj;","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/beemdevelopment/Aegis/blob/d6f4e5925a97e4e91593f1542085eae03432a759/app/src/main/java/com/beemdevelopment/aegis/importers/AegisImporter.java#L78-L114","documentation":"During Aegis vault import, decrypt runs PasswordSlotDecryptTask with the user-supplied password against the vault's password slots. When the task's result comes back null — meaning no password slot could be decrypted with that password — a DatabaseImporterException(\"Password incorrect\") is thrown. It signals the entered password cannot derive a key matching the file's key slots.","triggerScenarios":"Calling decrypt on an Aegis vault file while supplying a password that doesn't match any PasswordSlot in the file: wrong password, wrong file's password, password changed after the export was made, or whitespace/encoding issues in the input.","commonSituations":"User forgot or mistyped the vault password; trying the current vault password on an older backup encrypted with a previous password; importing a different authenticator's file as an Aegis vault; trailing newline or wrong keyboard layout when typing the password.","solutions":["Re-enter the password carefully (check keyboard layout, caps lock, trailing spaces)","Try passwords used for older vault versions if the export is from an older backup","Confirm the file being imported is actually an Aegis encrypted vault export","If the password is truly lost, the vault data cannot be recovered — restore from another backup"],"exampleFix":"// before\nPasswordSlotDecryptTask.Params params = new PasswordSlotDecryptTask.Params(slots, password.trim());\n// after — no code fix; retry with the correct credential\nDialogs.showPasswordInputDialog(context, listener); // re-prompt user until decrypt succeeds","handlingStrategy":"retry","validationCode":"// nothing to validate programmatically — verify with the user that the password\n// and the source file (an Aegis-encrypted vault export) are correct before decrypting","typeGuard":null,"tryCatchPattern":"try {\n    State state = importer.decrypt(creds);\n    listener.onStateDecrypted(state);\n} catch (DatabaseImporterException e) {\n    if (\"Password incorrect\".equals(e.getMessage())) {\n        Dialogs.showPasswordInputDialog(context, R.string.enter_password_aegis_title, listener); // re-prompt\n    }\n}","preventionTips":["Prompt the user to re-enter the password rather than failing outright","Confirm the export file is an Aegis vault and matches the password's era","Trim whitespace and mind keyboard layout when capturing passwords","Keep backups exported before password changes"],"tags":["password","decryption","import","vault"],"backgroundTag":"incorrect-password","analyzedSha":"d6f4e5925a97e4e91593f1542085eae03432a759","analyzedAt":"2026-09-08T00:46:31.111Z","contentChangedAt":"2026-09-08T00:46:31.111Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}