CodeKharl/cryptacount ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Python app that analyzes password strength using discrete math ideas like permutations, combinations, and the rule of product. I want to give it a password length and choose which character types are allowed, like lowercase, uppercase, digits, and symbols, and optionally require exact counts for some types, like exactly 2 digits or 1 symbol.

The program should calculate the total search space, show the entropy in bits, and generate a random password that matches the rules. If the exact requirements cannot fit the length, it should fail clearly with a helpful error. I also want it to work from the command line, and if possible include a simple example run from the package itself.

Please make the generated password use secure random generation, and print the main results in a clean readable way so it feels like a useful little tool for checking password strength.