File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -818,11 +818,14 @@ function handleGeneratePassword() {
818818 if ( icloudPresetCheckbox . checked ) {
819819 const pwd = generateIcloudPassword ( ) ;
820820 passwordInput . value = pwd ;
821- strengthLabelEl . textContent = "" ;
822- strengthBarEl . style . background = "green" ;
821+
822+ // iCloud: 18 letters + 1 digit, pool ~26 letters + 10 digits
823+ // Format: 3 chunks of 6 letters (CVC-CVC) + 1 digit + 1 uppercase
824+ // Entropy: 18 letters from 26 lowercase + 1 digit from 10
825+ const entropyBits = 18 * Math . log2 ( 26 ) + 1 * Math . log2 ( 10 ) ;
826+ strengthLabelEl . textContent = entropyBits < 45 ? "Weak" : entropyBits < 70 ? "Medium" : "Strong" ;
827+ strengthBarEl . style . background = entropyBits < 45 ? "red" : entropyBits < 70 ? "orange" : "green" ;
823828
824- // iCloud preset: fixed entropy estimate (~71 bits)
825- const entropyBits = 71 ;
826829 updateCrackTimeUI ( entropyBits ) ;
827830 return ;
828831 }
You can’t perform that action at this time.
0 commit comments