├── .editorconfig ├── .gitattributes ├── .gitignore ├── Images ├── change.png ├── charsets.png ├── entry.png ├── group.png ├── menu.png ├── profile.png └── rule.png ├── LICENSE ├── README.md ├── RuleBuilder.sln ├── RuleBuilder ├── App.config ├── Forms │ ├── ChangePassword.xaml │ ├── ChangePassword.xaml.cs │ ├── EditRule.xaml │ ├── EditRule.xaml.cs │ ├── EditRuleModel.cs │ └── EntryFormMod.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Images.Designer.cs │ ├── Images.resx │ ├── ImagesHigh.Designer.cs │ ├── ImagesHigh.resx │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ ├── IconsHigh │ │ ├── Dice.png │ │ ├── NewPassword.png │ │ └── Organizer.png │ ├── IconsLow │ │ ├── Dice.png │ │ ├── NewPassword.png │ │ └── Organizer.png │ ├── Refresh.png │ ├── Strings.xaml │ └── Styles.xaml ├── Rule │ ├── CharacterClass.cs │ ├── Component.cs │ ├── Configuration.cs │ ├── Expiration.cs │ ├── IPasswordGenerator.cs │ ├── PasswordProfile.cs │ ├── PasswordRule.cs │ ├── Random.cs │ ├── RuleProperty.cs │ └── Serialization │ │ ├── CharacterClassContract.cs │ │ ├── ComponentContract.cs │ │ ├── ConfigurationContract.cs │ │ ├── Entry.cs │ │ ├── ExpirationContract.cs │ │ ├── ProfileContract.cs │ │ └── RuleContract.cs ├── RuleBuilder.csproj ├── RuleBuilderExt.cs ├── Util │ ├── ComponentTemplateSelector.cs │ ├── Entropy.cs │ ├── Hotkey.cs │ ├── IntegerRangeRule.cs │ ├── NativeMethods.cs │ └── ScaledResourceManager.cs └── version.txt └── RuleBuilderTests ├── Properties └── AssemblyInfo.cs ├── Rule ├── CharacterClassTests.cs ├── ComponentTests.cs ├── ExpirationTests.cs ├── PasswordProfileTests.cs ├── PasswordRuleTests.cs ├── RandomTests.cs └── Serialization │ ├── CharacterClassContractTests.cs │ ├── ComponentContractTests.cs │ ├── ConfigurationContractTests.cs │ ├── EntryTests.cs │ ├── ProfileContractTests.cs │ └── RuleContractTests.cs ├── RuleBuilderTests.csproj ├── Util └── EntropyTests.cs └── packages.config /.editorconfig: -------------------------------------------------------------------------------- 1 | # Remove the line below if you want to inherit .editorconfig settings from higher directories 2 | root = true 3 | 4 | # C# files 5 | [*.cs] 6 | 7 | #### Core EditorConfig Options #### 8 | 9 | # Indentation and spacing 10 | indent_size = 4 11 | indent_style = tab 12 | tab_width = 4 13 | 14 | # New line preferences 15 | end_of_line = crlf 16 | insert_final_newline = false 17 | 18 | #### .NET Coding Conventions #### 19 | 20 | # Organize usings 21 | dotnet_separate_import_directive_groups = false 22 | dotnet_sort_system_directives_first = true 23 | 24 | # this. and Me. preferences 25 | dotnet_style_qualification_for_event = true:silent 26 | dotnet_style_qualification_for_field = true:silent 27 | dotnet_style_qualification_for_method = true:silent 28 | dotnet_style_qualification_for_property = true:silent 29 | 30 | # Language keywords vs BCL types preferences 31 | dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion 32 | dotnet_style_predefined_type_for_member_access = true:suggestion 33 | 34 | # Parentheses preferences 35 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent 36 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent 37 | dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent 38 | dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent 39 | 40 | # Modifier preferences 41 | dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent 42 | 43 | # Expression-level preferences 44 | csharp_style_deconstructed_variable_declaration = true:suggestion 45 | csharp_style_inlined_variable_declaration = true:silent 46 | csharp_style_throw_expression = true:silent 47 | dotnet_style_coalesce_expression = true:silent 48 | dotnet_style_collection_initializer = true:silent 49 | dotnet_style_explicit_tuple_names = true:suggestion 50 | dotnet_style_null_propagation = true:silent 51 | dotnet_style_object_initializer = true:silent 52 | dotnet_style_prefer_auto_properties = true:silent 53 | dotnet_style_prefer_compound_assignment = true:suggestion 54 | dotnet_style_prefer_conditional_expression_over_assignment = true:silent 55 | dotnet_style_prefer_conditional_expression_over_return = true:silent 56 | dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion 57 | dotnet_style_prefer_inferred_tuple_names = true:suggestion 58 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion 59 | 60 | # Field preferences 61 | dotnet_style_readonly_field = true:suggestion 62 | 63 | # Parameter preferences 64 | dotnet_code_quality_unused_parameters = all:suggestion 65 | 66 | #### C# Coding Conventions #### 67 | 68 | # var preferences 69 | csharp_style_var_elsewhere = false:warning 70 | csharp_style_var_for_built_in_types = false:silent 71 | csharp_style_var_when_type_is_apparent = false:silent 72 | 73 | # Expression-bodied members 74 | csharp_style_expression_bodied_accessors = when_on_single_line:silent 75 | csharp_style_expression_bodied_constructors = false:silent 76 | csharp_style_expression_bodied_indexers = when_on_single_line:silent 77 | csharp_style_expression_bodied_lambdas = true:silent 78 | csharp_style_expression_bodied_local_functions = false:silent 79 | csharp_style_expression_bodied_methods = when_on_single_line:silent 80 | csharp_style_expression_bodied_operators = when_on_single_line:silent 81 | csharp_style_expression_bodied_properties = when_on_single_line:silent 82 | 83 | # Pattern matching preferences 84 | csharp_style_pattern_matching_over_as_with_null_check = true:silent 85 | csharp_style_pattern_matching_over_is_with_cast_check = true:silent 86 | 87 | # Null-checking preferences 88 | csharp_style_conditional_delegate_call = true:silent 89 | 90 | # Modifier preferences 91 | csharp_prefer_static_local_function = true:suggestion 92 | csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async 93 | 94 | # Code-block preferences 95 | csharp_prefer_braces = true:warning 96 | csharp_prefer_simple_using_statement = true:suggestion 97 | 98 | # Expression-level preferences 99 | csharp_prefer_simple_default_expression = true:suggestion 100 | csharp_style_pattern_local_over_anonymous_function = true:suggestion 101 | csharp_style_prefer_index_operator = true:suggestion 102 | csharp_style_prefer_range_operator = true:suggestion 103 | csharp_style_unused_value_assignment_preference = discard_variable:silent 104 | csharp_style_unused_value_expression_statement_preference = discard_variable:silent 105 | 106 | # 'using' directive preferences 107 | csharp_using_directive_placement = outside_namespace:silent 108 | 109 | #### C# Formatting Rules #### 110 | 111 | # New line preferences 112 | csharp_new_line_before_catch = false 113 | csharp_new_line_before_else = false 114 | csharp_new_line_before_finally = false 115 | csharp_new_line_before_members_in_anonymous_types = true 116 | csharp_new_line_before_members_in_object_initializers = true 117 | csharp_new_line_before_open_brace = none 118 | csharp_new_line_between_query_expression_clauses = true 119 | 120 | # Indentation preferences 121 | csharp_indent_block_contents = true 122 | csharp_indent_braces = false 123 | csharp_indent_case_contents = true 124 | csharp_indent_case_contents_when_block = true 125 | csharp_indent_labels = one_less_than_current 126 | csharp_indent_switch_labels = true 127 | 128 | # Space preferences 129 | csharp_space_after_cast = false 130 | csharp_space_after_colon_in_inheritance_clause = true 131 | csharp_space_after_comma = true 132 | csharp_space_after_dot = false 133 | csharp_space_after_keywords_in_control_flow_statements = true 134 | csharp_space_after_semicolon_in_for_statement = true 135 | csharp_space_around_binary_operators = before_and_after 136 | csharp_space_around_declaration_statements = false 137 | csharp_space_before_colon_in_inheritance_clause = true 138 | csharp_space_before_comma = false 139 | csharp_space_before_dot = false 140 | csharp_space_before_open_square_brackets = false 141 | csharp_space_before_semicolon_in_for_statement = false 142 | csharp_space_between_empty_square_brackets = false 143 | csharp_space_between_method_call_empty_parameter_list_parentheses = false 144 | csharp_space_between_method_call_name_and_opening_parenthesis = false 145 | csharp_space_between_method_call_parameter_list_parentheses = false 146 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false 147 | csharp_space_between_method_declaration_name_and_open_parenthesis = false 148 | csharp_space_between_method_declaration_parameter_list_parentheses = false 149 | csharp_space_between_parentheses = false 150 | csharp_space_between_square_brackets = false 151 | 152 | # Wrapping preferences 153 | csharp_preserve_single_line_blocks = true 154 | csharp_preserve_single_line_statements = false 155 | 156 | #### Naming styles #### 157 | 158 | # Naming rules 159 | 160 | dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion 161 | dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface 162 | dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i 163 | 164 | dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion 165 | dotnet_naming_rule.types_should_be_pascal_case.symbols = types 166 | dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case 167 | 168 | dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion 169 | dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members 170 | dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case 171 | 172 | # Symbol specifications 173 | 174 | dotnet_naming_symbols.interface.applicable_kinds = interface 175 | dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal 176 | dotnet_naming_symbols.interface.required_modifiers = 177 | 178 | dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum 179 | dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal 180 | dotnet_naming_symbols.types.required_modifiers = 181 | 182 | dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method 183 | dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal 184 | dotnet_naming_symbols.non_field_members.required_modifiers = 185 | 186 | # Naming styles 187 | 188 | dotnet_naming_style.pascal_case.required_prefix = 189 | dotnet_naming_style.pascal_case.required_suffix = 190 | dotnet_naming_style.pascal_case.word_separator = 191 | dotnet_naming_style.pascal_case.capitalization = pascal_case 192 | 193 | dotnet_naming_style.begins_with_i.required_prefix = I 194 | dotnet_naming_style.begins_with_i.required_suffix = 195 | dotnet_naming_style.begins_with_i.word_separator = 196 | dotnet_naming_style.begins_with_i.capitalization = pascal_case 197 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Cake - Uncomment if you are using it 306 | # tools/** 307 | # !tools/packages.config 308 | 309 | # Tabs Studio 310 | *.tss 311 | 312 | # Telerik's JustMock configuration file 313 | *.jmconfig 314 | 315 | # BizTalk build output 316 | *.btp.cs 317 | *.btm.cs 318 | *.odx.cs 319 | *.xsd.cs 320 | 321 | # OpenCover UI analysis results 322 | OpenCover/ 323 | 324 | # Azure Stream Analytics local run output 325 | ASALocalRun/ 326 | 327 | # MSBuild Binary and Structured Log 328 | *.binlog 329 | 330 | # NVidia Nsight GPU debugger configuration file 331 | *.nvuser 332 | 333 | # MFractors (Xamarin productivity tool) working folder 334 | .mfractor/ 335 | 336 | # Local History for Visual Studio 337 | .localhistory/ 338 | 339 | # BeatPulse healthcheck temp database 340 | healthchecksdb -------------------------------------------------------------------------------- /Images/change.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihanson/KeePass-Rule-Builder/a225049bca357d323c651c331c65e5f7975fedf5/Images/change.png -------------------------------------------------------------------------------- /Images/charsets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihanson/KeePass-Rule-Builder/a225049bca357d323c651c331c65e5f7975fedf5/Images/charsets.png -------------------------------------------------------------------------------- /Images/entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihanson/KeePass-Rule-Builder/a225049bca357d323c651c331c65e5f7975fedf5/Images/entry.png -------------------------------------------------------------------------------- /Images/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihanson/KeePass-Rule-Builder/a225049bca357d323c651c331c65e5f7975fedf5/Images/group.png -------------------------------------------------------------------------------- /Images/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihanson/KeePass-Rule-Builder/a225049bca357d323c651c331c65e5f7975fedf5/Images/menu.png -------------------------------------------------------------------------------- /Images/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihanson/KeePass-Rule-Builder/a225049bca357d323c651c331c65e5f7975fedf5/Images/profile.png -------------------------------------------------------------------------------- /Images/rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihanson/KeePass-Rule-Builder/a225049bca357d323c651c331c65e5f7975fedf5/Images/rule.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Ira Hanson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KeePass Rule Builder 2 | This is a plugin for the [KeePass 2](https://keepass.info/) password manager. With this plugin, you can use the KeePass database to keep track of all of the different requirements that websites have for account passwords, and easily generate new passwords according to those requirements. 3 | 4 | The strongest passwords are randomly generated. However, some services unwisely place constraints on the passwords that you can use. A website may state that a password must be less than a certain length, or that it must contain certain types of characters, or that it must *not* contain certain other characters. To make matters worse, every website has different requirements, so changing passwords means reconfiguring your password generator every time. 5 | 6 | The [password generator](https://keepass.info/help/base/pwgenerator.html) in KeePass helps with these challenges, but it can still be difficult to configure it to exactly meet the requirements of each service while keeping passwords as strong as possible. 7 | 8 | The purpose of this plugin is to make it easy to tell KeePass how to generate a password for each service and to streamline the process of changing passwords. 9 | 10 | ## Installation 11 | To install this plugin, download the latest version from the [Releases](https://github.com/ihanson/KeePass-Rule-Builder/releases) page and copy it into your KeePass installation’s Plugins directory. Do not rename the DLL file. See the [KeePass documentation](https://keepass.info/help/v2/plugins.html) for more help. 12 | 13 | This plugin is also available as a [Chocolatey package](https://community.chocolatey.org/packages/keepass-plugin-rulebuilder). I am not the maintainer of this package. 14 | 15 | ## How to use 16 | ### Changing a password 17 | To change a password for an entry in KeePass, right-click the password entry and click **Generate New Password**. 18 | 19 | Context menu with “Generate New Password” selected 20 | 21 | The Change Password window will open. This window shows the current password as well as a new randomly generated password. Copy those passwords into the appropriate fields where you are setting the password. You can also use the hotkeys **Ctrl+Shift+Z** and **Ctrl+Shift+X** to auto-type the old and new passwords, respectively. If you want to set an expiration date, you can do that here. 22 | 23 | Change Password window 24 | 25 | Once you have successfully changed the password, click **Save New Password** to store the new password into the KeePass database. Every time you change the password, the old password will be backed up in the entry’s [history](https://keepass.info/help/v2/entry.html#hst). 26 | 27 | ### Password rules 28 | By default, this tool will generate a new password based on the **Automatically generated passwords for new entries** profile in KeePass. You should [configure this profile](https://keepass.info/help/base/pwgenerator.html#configauto) to produce a very strong password. However, for services for which the passwords generated by this profile are [*too* strong](https://twitter.com/PWTooStrong), the plugin can help you generate a password according to each service’s individual password policy. 29 | 30 | To specify the rules constraining your password, click the **Edit Rule** button from the Change Password window, or select **Edit Password Rule** from the entry context menu. In the Password Rule window, you can specify the rule in one of two ways. 31 | 32 | #### Profile 33 | You can select an existing KeePass profile—either one that is built into KeePass or a custom one that you have created. To choose this option, select **Profile** and choose the profile you want to use. 34 | 35 | The Password Rule dialog with the Profile option selected 36 | 37 | #### Rule 38 | You can also build a password rule by providing a list of the character sets that may, must, or must not be used in the password. To enter a password rule in this way, select the **Rule** option in the Password Rule dialog. 39 | 40 | Let’s say that a website requires passwords with the following properties: 41 | 42 | - A password must be 8–20 characters long. 43 | - A password must contain at least one letter. 44 | - A password must contain at least one digit. 45 | - A password may contain special characters, from the character set `!@#$%^&*()`. 46 | - Passwords must be changed every 18 months. 47 | 48 | As shown in the screenshot below, we will first enter a **Length** of *20*, the maximum password length. (There is no point in generating a password shorter than the maximum length.) Then click the **Add Character Set** button to add the built-in **Letters** and **Digits** character sets, and specify that both of them are **Required**. Click **Add Character Set** again to select a **Custom** character set, which you can then populate with the “special characters” listed in the password requirements. Finally, indicate that a password generated from this rule expires after 18 months. 49 | 50 | The Password Rule dialog with the Rule option selected 51 | 52 | Other options available in the Add Character Set menu are **All characters**, **Punctuation**, **Uppercase letters**, and **Lowercase letters**. If the service for which you are generating a password requires that a password *not* contain certain characters, you can enter those into the **Exclude** field. 53 | 54 | The Add Character Set menu 55 | 56 | The **Example** field in the Edit Rule window shows a sample password that follows the rule or profile that you have selected. (This is not the same password that will be set to the password entry when you save it.) 57 | 58 | The [password strength](https://en.wikipedia.org/wiki/Password_strength) is calculated from the configured rule (not the generated password). Every additional bit of strength represents a doubling of the expected time it would take for a hacker to guess the password by brute force. 59 | 60 | Once you have finished entering the password requirements, click **Accept**. If you were editing the rule from the Change Password window, a new password will automatically be generated using your new rule. Follow the steps above to save this password. 61 | 62 | Any time you need to generate another password, just use the Generate New Password menu item. It will automatically use the rule and expiration date that you have set for that entry. 63 | 64 | ### Other features 65 | You can access this plugin’s features from the password generation menu in the standard KeePass editor window. Click **Generate From Rule** to generate a new password based on the entry’s configured rule, or click **Edit Password Rule** to edit the rule. Click **Open Built-in Password Generator** to access the normal KeePass password generator. 66 | 67 | The Add Entry dialog with the Generate From Rule and Edit Password Rule menu items visible 68 | 69 | A rule can be configured for a group of entries. This option is available in the context menu of the group. If a group has a rule configured, all entries in that group will use that rule when a password is generated, unless the rule is overridden in the entry itself. 70 | 71 | The group context menu with the Edit Password Rule menu item visible 72 | 73 | --- 74 | Icons made by [Freepik](https://www.flaticon.com/authors/freepik "Freepik") from [www.flaticon.com](https://www.flaticon.com/ "Flaticon") 75 | -------------------------------------------------------------------------------- /RuleBuilder.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32328.378 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RuleBuilder", "RuleBuilder\RuleBuilder.csproj", "{6A61D4EB-BA26-4E32-906E-DEF1280163AD}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RuleBuilderTests", "RuleBuilderTests\RuleBuilderTests.csproj", "{9A7EE14B-4E48-40A2-898E-1139329BFA03}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EB95F864-50D9-491E-A787-E87ED1694325}" 11 | ProjectSection(SolutionItems) = preProject 12 | LICENSE = LICENSE 13 | README.md = README.md 14 | EndProjectSection 15 | EndProject 16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Images", "Images", "{9B39E0D1-37E2-488E-B073-54AA16495410}" 17 | ProjectSection(SolutionItems) = preProject 18 | Images\change.png = Images\change.png 19 | Images\charsets.png = Images\charsets.png 20 | Images\entry.png = Images\entry.png 21 | Images\group.png = Images\group.png 22 | Images\menu.png = Images\menu.png 23 | Images\profile.png = Images\profile.png 24 | Images\rule.png = Images\rule.png 25 | EndProjectSection 26 | EndProject 27 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{A8F703CE-B688-45F7-B5D3-BFD2E3B105E5}" 28 | ProjectSection(SolutionItems) = preProject 29 | .editorconfig = .editorconfig 30 | .gitattributes = .gitattributes 31 | .gitignore = .gitignore 32 | .github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml 33 | EndProjectSection 34 | EndProject 35 | Global 36 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 37 | Debug|Any CPU = Debug|Any CPU 38 | Release|Any CPU = Release|Any CPU 39 | EndGlobalSection 40 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 41 | {6A61D4EB-BA26-4E32-906E-DEF1280163AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 42 | {6A61D4EB-BA26-4E32-906E-DEF1280163AD}.Debug|Any CPU.Build.0 = Debug|Any CPU 43 | {6A61D4EB-BA26-4E32-906E-DEF1280163AD}.Release|Any CPU.ActiveCfg = Release|Any CPU 44 | {6A61D4EB-BA26-4E32-906E-DEF1280163AD}.Release|Any CPU.Build.0 = Release|Any CPU 45 | {9A7EE14B-4E48-40A2-898E-1139329BFA03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 46 | {9A7EE14B-4E48-40A2-898E-1139329BFA03}.Debug|Any CPU.Build.0 = Debug|Any CPU 47 | {9A7EE14B-4E48-40A2-898E-1139329BFA03}.Release|Any CPU.ActiveCfg = Release|Any CPU 48 | {9A7EE14B-4E48-40A2-898E-1139329BFA03}.Release|Any CPU.Build.0 = Release|Any CPU 49 | EndGlobalSection 50 | GlobalSection(SolutionProperties) = preSolution 51 | HideSolutionNode = FALSE 52 | EndGlobalSection 53 | GlobalSection(NestedProjects) = preSolution 54 | {9B39E0D1-37E2-488E-B073-54AA16495410} = {EB95F864-50D9-491E-A787-E87ED1694325} 55 | {A8F703CE-B688-45F7-B5D3-BFD2E3B105E5} = {EB95F864-50D9-491E-A787-E87ED1694325} 56 | EndGlobalSection 57 | GlobalSection(ExtensibilityGlobals) = postSolution 58 | SolutionGuid = {74AB2C26-02C4-43E8-84EC-13CA0B1C150B} 59 | EndGlobalSection 60 | EndGlobal 61 | -------------------------------------------------------------------------------- /RuleBuilder/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /RuleBuilder/Forms/ChangePassword.xaml: -------------------------------------------------------------------------------- 1 |  13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 |