Metadata-Version: 2.1
Name: keytitan
Version: 1.0.0
Summary: Create and validate strong password
Author-email: Suryansh Pandey <suryanshp1@gmail.com>
License: The MIT License (MIT)
        Copyright © 2023 <copyright holders>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Keywords: security,password,authentication
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tomli; python_version < "3.11"
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: bumpver; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: pip-tools; extra == "dev"

# KeyTitan Password Generator and Validator

The provided Python code defines a class called `KeyTitan` that serves as a password generator and validator. It generates random passwords that meet certain criteria and validates passwords against specific rules.

## KeyTitan Class

The `KeyTitan` class has the following methods:

### `__init__(self, length=12)`

This is the constructor method for the `KeyTitan` class. It allows you to initialize an instance of the class with an optional password length, with a default length of 12 characters.

### `generate_password(self)`

This method generates a random password based on specified criteria. The criteria for the generated password are as follows:
- The password must be at least 8 characters long.
- It must include at least one uppercase letter, one lowercase letter, one digit, and one special character.
- The remaining characters are randomly chosen from all character sets.
- The order of characters in the password is randomized.

If the password length is less than 8, a `ValueError` is raised. Otherwise, a password is generated and returned.

### `validate_password(self, password)`

This method validates a given password against specific criteria, including:
- The password must be at least 8 characters long.
- It must include at least one uppercase letter, one lowercase letter, one digit, and one special character.

If the password meets these criteria, the method returns `True`. If not, it prints error messages for the specific criteria that the password does not meet and returns `False`.

## Example Usage

The code provides an example of how to use the `KeyTitan` class:
1. An instance of the `KeyTitan` class is created with a specified password length of 10 characters.
2. A random password is generated using the `generate_password` method and printed to the console.
3. The generated password is then validated using the `validate_password` method against the same criteria. If the password is valid, it prints "Password is valid." Otherwise, it prints error messages for the criteria that are not met.

## Summary

The `KeyTitan` class provides a simple and customizable way to generate and validate passwords based on specific criteria. It ensures that generated passwords meet security standards by requiring a minimum length and including a mix of character types. The code can be easily integrated into applications or scripts that require secure password generation and validation.
