System cryptography: Force strong key protection for user keys stored on the computer: registry value ForceKeyProtectionComputerHKLM\SOFTWARE\Policies\Microsoft\Cryptography
- Category
- Security Settings › Local Policies › Security Options
- Scope
- Computer Configuration
- Source
- Windows 11 (version 26H2 · 26300.9457)
Registry
ForceKeyProtection
REG_DWORDComputerHKLM\SOFTWARE\Policies\Microsoft\Cryptography Current key
- Enabled value
- Depends on the option value
- Element
- System cryptography: Force strong key protection for user keys stored on the computer
| Item | Stored value |
|---|---|
| User input is not required when new keys are stored and used | 0 |
| User is prompted when the key is first used | 1 |
| User must enter a password each time they use a key | 2 |
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography] ; Options (use only one) ; User input is not required when new keys are stored and used "ForceKeyProtection"=dword:00000000 ; User is prompted when the key is first used "ForceKeyProtection"=dword:00000001 ; User must enter a password each time they use a key "ForceKeyProtection"=dword:00000002
CMD
:: Options (use only one) :: User input is not required when new keys are stored and used reg add "HKLM\SOFTWARE\Policies\Microsoft\Cryptography" /v "ForceKeyProtection" /t REG_DWORD /d 0 /f :: User is prompted when the key is first used reg add "HKLM\SOFTWARE\Policies\Microsoft\Cryptography" /v "ForceKeyProtection" /t REG_DWORD /d 1 /f :: User must enter a password each time they use a key reg add "HKLM\SOFTWARE\Policies\Microsoft\Cryptography" /v "ForceKeyProtection" /t REG_DWORD /d 2 /f
PowerShell
# Common: create the key New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Cryptography' -Force | Out-Null # Options (use only one) # User input is not required when new keys are stored and used New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Cryptography' -Name 'ForceKeyProtection' -PropertyType DWord -Value 0 -Force | Out-Null # User is prompted when the key is first used New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Cryptography' -Name 'ForceKeyProtection' -PropertyType DWord -Value 1 -Force | Out-Null # User must enter a password each time they use a key New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Cryptography' -Name 'ForceKeyProtection' -PropertyType DWord -Value 2 -Force | Out-Null