What changed, and why it matters
This commit is a user-interface cleanup, not a security fix. It moves the existing password-strength meter into a reusable component and adds it to the password-change dialog. The actual password-strength calculation is still performed by the same backend function as before, and no new behavior that would create or fix a security issue is visible in the diff.
No security action required. Treat as a normal UI refactor review.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The merge refactors duplicated QML password-strength UI code into a new MoneroComponents.PasswordStrengthBar component. WizardAskPassword now instantiates that component instead of its inline progress bar, and PasswordDialog gains the same strength bar when in new-password mode. The call sites that previously used calcStrengthAndVerify() now use passwordsMatch(), because strength calculation is handled reactively inside the new component. The underlying walletManager.getPasswordStrength() call and the scoring math remain effectively unchanged.
Changed components
components/PasswordDialog.qmlcomponents/PasswordStrengthBar.qmlwizard/WizardAskPassword.qmlwizard/WizardCreateWallet3.qmlwizard/WizardRestoreWallet2.qmlInspect captured patch +139 / −83
### components/PasswordDialog.qml
@@ -225,6 +225,13 @@ FocusScope {
Keys.onReturnPressed: root.onOk()
Keys.onEscapePressed: root.onCancel()
}
+ // Show password strength bar
+ MoneroComponents.PasswordStrengthBar {
+ id: passwordStrengthBar
+ Layout.fillWidth: true
+ password: passwordInput1.text
+ visible: newPasswordDialogMode && passwordStrengthBar.passwordStrengthAvailable
+ }
// padding
Rectangle {
### components/PasswordStrengthBar.qml
@@ -0,0 +1,123 @@
+// Copyright (c) 2026, The Monero Project
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this list of
+// conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import QtQuick
+import QtQuick.Layouts
+
+import "." as MoneroComponents
+
+ColumnLayout {
+ id: root
+
+ property string password
+ property int passwordFill: 0
+ property string passwordStrengthText: qsTr("Strength: ") + translationManager.emptyString
+ readonly property bool passwordStrengthAvailable: !isAndroid && walletManager.getPasswordStrength !== undefined
+ readonly property int strengthLevel: passwordFill <= 33 ? 0 : (passwordFill <= 66 ? 1 : 2)
+ readonly property string strengthString: {
+ if (strengthLevel === 0) {
+ return qsTr("Low") + translationManager.emptyString;
+ } else if (strengthLevel === 1) {
+ return qsTr("Medium") + translationManager.emptyString;
+ }
+ return qsTr("High") + translationManager.emptyString;
+ }
+ readonly property color strengthColor: {
+ if (strengthLevel === 0) {
+ return "#FF0000";
+ } else if (strengthLevel === 1) {
+ return MoneroComponents.Style.blackTheme ? "#FFFF00" : "#FFCC00";
+ }
+ return MoneroComponents.Style.blackTheme ? "#00FF00" : "#008000";
+ }
+
+ visible: passwordStrengthAvailable
+ spacing: 0
+
+ onPasswordChanged: calcPasswordStrength()
+ onVisibleChanged: {
+ if (visible) {
+ calcPasswordStrength();
+ }
+ }
+
+ function calcPasswordStrength() {
+ if (!visible) {
+ return;
+ }
+ if (password.length <= 1) {
+ root.passwordFill = 0;
+ }
+
+ // getPasswordStrength returns a value from 0 to... lots
+ var strength = walletManager.getPasswordStrength(password);
+ // consider anything below 10 bits as dire
+ strength -= 10;
+ if (strength < 0) {
+ strength = 0;
+ }
+ // use a slight parabola to discourage short passwords
+ strength = Math.pow(strength, 1.2) / 3;
+ strength += 20;
+ if (strength > 100) {
+ strength = 100;
+ }
+
+ root.passwordFill = strength;
+ }
+
+ MoneroComponents.TextPlain {
+ Layout.topMargin: 6
+ Layout.bottomMargin: 6
+ font.family: MoneroComponents.Style.fontMedium.name
+ font.pixelSize: 14
+ font.bold: false
+ color: MoneroComponents.Style.defaultFontColor
+ height: 18
+ text: root.passwordStrengthText + root.strengthString
+ }
+
+ Rectangle {
+ id: bar
+ Layout.fillWidth: true
+ Layout.preferredHeight: 8
+
+ radius: 8
+ color: MoneroComponents.Style.progressBarBackgroundColor
+
+ Rectangle {
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: bar.height
+ width: (bar.width * root.passwordFill) / 100
+ radius: 8
+ color: root.strengthColor
+ }
+ }
+}
### wizard/WizardAskPassword.qml
@@ -40,48 +40,15 @@ ColumnLayout {
Layout.fillWidth: true
property alias password: passwordInput.text
property alias passwordConfirm: passwordInputConfirm.text
- property int passwordFill: 0
- property string passwordStrengthText: qsTr("Strength: ") + translationManager.emptyString
+ property alias passwordFill: passwordStrengthBar.passwordFill
+ property alias passwordStrengthText: passwordStrengthBar.passwordStrengthText
- function calcStrengthAndVerify(){
- calcPasswordStrength();
+ function passwordsMatch(){
return passwordInput.text === passwordInputConfirm.text;
}
function calcPasswordStrength() {
- if(!progressLayout.visible) return;
- if(passwordInput.text.length <= 1){
- root.passwordFill = 0;
- progressText.text = passwordStrengthText + qsTr("Low") + translationManager.emptyString;
- }
-
- // scorePassword returns value from 0 to... lots
- var strength = walletManager.getPasswordStrength(passwordInput.text);
- // consider anything below 10 bits as dire
- strength -= 10
- if (strength < 0)
- strength = 0;
- // use a slight parabola to discourage short passwords
- strength = strength ^ 1.2 / 3
- strength += 20;
- if (strength > 100)
- strength = 100;
-
- root.passwordFill = strength;
-
- var strengthString;
- if(strength <= 33){
- strengthString = qsTr("Low");
- fillRect.color = "#FF0000";
- } else if(strength <= 66){
- strengthString = qsTr("Medium");
- fillRect.color = (MoneroComponents.Style.blackTheme ? "#FFFF00" : "#FFCC00");
- } else {
- strengthString = qsTr("High");
- fillRect.color = (MoneroComponents.Style.blackTheme ? "#00FF00" : "#008000");
- }
-
- progressText.text = passwordStrengthText + strengthString + translationManager.emptyString;
+ passwordStrengthBar.calcPasswordStrength();
}
spacing: 20
@@ -107,52 +74,11 @@ ColumnLayout {
labelText: qsTr("Password") + translationManager.emptyString
}
- ColumnLayout {
- id: progressLayout
- spacing: 0
- visible: !isAndroid && walletManager.getPasswordStrength !== undefined
+ MoneroComponents.PasswordStrengthBar {
+ id: passwordStrengthBar
Layout.fillWidth: true
Layout.topMargin: 0
-
- TextInput {
- id: progressText
- Layout.topMargin: 6
- Layout.bottomMargin: 6
- font.family: MoneroComponents.Style.fontMedium.name
- font.pixelSize: 14
- font.bold: false
- color: MoneroComponents.Style.defaultFontColor
- height: 18
- passwordCharacter: "*"
- }
-
- Rectangle {
- id: bar
- Layout.fillWidth: true
- Layout.preferredHeight: 8
-
- radius: 8
- color: MoneroComponents.Style.progressBarBackgroundColor
-
- Rectangle {
- id: fillRect
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: bar.height
- property int maxWidth: bar.width
- width: (maxWidth * root.passwordFill) / 100
- radius: 8
- color: "#FF0000"
- }
-
- Rectangle {
- color: MoneroComponents.Style.defaultFontColor
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.leftMargin: 8
- }
- }
+ password: passwordInput.text
}
}
### wizard/WizardCreateWallet3.qml
@@ -66,7 +66,7 @@ Rectangle {
id: wizardNav
progressSteps: appWindow.walletMode === 0 ? 4 : 5
progress: 2
- btnNext.enabled: passwordFields.calcStrengthAndVerify();
+ btnNext.enabled: passwordFields.passwordsMatch();
onPrevClicked: {
if(wizardController.walletOptionsIsRecoveringFromDevice){
wizardStateView.state = "wizardCreateDevice1";
### wizard/WizardRestoreWallet2.qml
@@ -70,7 +70,7 @@ Rectangle {
id: wizardNav
progressSteps: appWindow.walletMode === 0 ? 3 : 4
progress: 1
- btnNext.enabled: passwordFields.calcStrengthAndVerify();
+ btnNext.enabled: passwordFields.passwordsMatch();
onPrevClicked: {
wizardStateView.state = "wizardRestoreWallet1";
}Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.