Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md about testing package use cases and Instructions #45

Merged
merged 4 commits into from
Jan 19, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 68 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,88 @@ This Python package is useful for users seeking an integrated solution for passw
There are many password related packages already on the PyPI server. We have selected a few key examples that complete the same functions as our package. An example of a package that is similar to our password_creator function can be found [here](https://pypi.org/project/easy-password-generator/). Similarly, there are also other packages that check for the strength of passwords, one of which can be seen [here](https://pypi.org/project/password-strength/), this is similar to our password_strength function. There is also a [password encryption package](https://pypi.org/project/password/) which does the same thing as our password_encryption functions. However, there were no password decryption specific function on PyPI. The advantage of our package lies in its comprehensive suite of password-related functions, complemented by an original and intuitive algorithm that demonstrates the fundamental principles of password encryption and decryption.

## Installation
For release 1.0.0, install the `passwordler` locally:
```
$ conda create --name passwordler python=3.11 -y
$ conda activate passwordler
$ pip install poetry
$ poetry install
$ pip install passwordler
```

## Using `passwordler` in Python

After installing `passwordler` with pip, you can use its functions in Python as follows:

1. **Encrypting a Password**:

```python
from passwordler import encrypt_password

# Encrypt a password with a default seed
encrypted_password = encrypt_password("YourPasswordHere")
print(encrypted_password) # Prints the encrypted password
```

If you want to use a specific seed for the encryption, you can pass it as a second argument:

```python
# Encrypt a password with a specific seed
encrypted_password = encrypt_password("YourPasswordHere", 42)
print(encrypted_password) # Prints the encrypted password using the specified seed
```

2. **Decrypting a Password**:

To decrypt a password that was encrypted with the `encrypt_password` function, use the `decrypt_password` function with the same seed used for encryption:

```python
from passwordler import decrypt_password

# Decrypt a password
decrypted_password = decrypt_password(encrypted_password, 42)
print(decrypted_password) # Prints the decrypted password, which should match "YourPasswordHere"
```

3. **Evaluating Password Strength**:

The `password_strength` function evaluates the strength of a password based on length, use of uppercase letters, numbers, and special characters:

```python
from passwordler import password_strength

# Evaluate the strength of a password
strength = password_strength("YourPasswordHere")
print(strength) # Prints the strength of the password (e.g., 'Your password is: Strong')
```

Remember to replace `"YourPasswordHere"` with the actual password you wish to process in the above examples. The `password_strength` function will rate the password as 'Weak', 'Good', or 'Strong' based on its complexity and common password patterns.

### Running Tests

To ensure `passwordler` is functioning correctly on your system, you can run the test suite with `pytest`. First, ensure you have `pytest` installed:

```bash
$ pip install pytest
```

If you have cloned the repository and want to run the tests, navigate to the root directory of the project and execute:

```bash
$ pytest
```

## Contributing
For information about how to contribute to this package, please review our [Contributing document](https://github.com/UBC-MDS/passwordler/blob/main/CONTRIBUTING.md). All contributors must abide by our [Code of Conduct](https://github.com/UBC-MDS/passwordler/blob/main/CONDUCT.md)

## License
This packages uses the MIT License, more information can be found [here](https://github.com/UBC-MDS/passwordler/blob/main/LICENSE)


## Credits
`passwordler` was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter)

## Contributors
- Michelle Hunn
- Kiersten Gilberg
- Rory White
- Yiwei Zhang
- Yiwei Zhang