Skip to main content

AnythingPassword

Password Management and Encryption Application

Overview

This Python application provides a suite of tools for generating, analyzing, encrypting, and managing passwords securely. It includes functionality to generate strong random passwords, evaluate password strength, calculate password entropy and crack time, check for password expiration, and detect common passwords. Additionally, it supports secure password encryption and decryption using the Fernet symmetric encryption algorithm, with the encryption key stored securely in the same directory as the script.

The application is designed to be modular, secure, and user-friendly, with robust error handling and platform compatibility (Unix-like systems and Windows).


✨ Features

🔑 Password Generation

  • Generates random passwords of specified length using a mix of lowercase, uppercase, digits, and special characters.
  • Default length is 8 characters if not specified.

🛡️ Password Strength Analysis

  • Evaluates passwords based on length, character types (uppercase, lowercase, digits, special characters), and commonality.
  • Provides feedback and a strong password suggestion if the input password is weak.
  • Checks against a list of common passwords.

📊 Password Security Metrics

  • Calculates password entropy (in bits) to measure randomness.
  • Estimates the time required to crack a password via brute force in seconds, minutes, or hours.
  • Checks if a password has expired based on a creation timestamp and maximum age (default 90 days).

🔐 Password Encryption/Decryption

  • Encrypts passwords using a securely generated Fernet key.
  • Decrypts encrypted passwords using the same key.
  • Stores the encryption key securely in the script’s directory with restricted permissions.

🗝️ Key Management

  • Generates and saves a Fernet key to a file (encryption_key.key) in the script’s directory.
  • Loads the key from the file for encryption/decryption.
  • Ensures secure file permissions (owner-only read/write on Unix-like systems).

📦 Installation

pip install anythingpassword

## Sample Usage
from anythingpassword import (
    generatekey,
    loadkey,
    passencrypt,
    passdecrypt,
    passgenerator,
    passanalyzer,
    passentropy,
    passcracktime,
    passexpiration,
    passcommon
)
from datetime import datetime, timedelta

# Generate and save a new encryption key
key = generatekey()
print("Encryption key generated and saved.")

# Load the encryption key
loaded_key = loadkey()
print("Encryption key loaded.")

# Generate a random password
password = passgenerator(12)
print(f"Generated Password: {password}")

# Analyze password strength
is_strong, feedback = passanalyzer(password)
print("Strength Check:")
print(feedback)

# Calculate password entropy
entropy = passentropy(password)
print(f"Password Entropy: {entropy} bits")

# Estimate crack time
crack_time_sec = passcracktime(password, unit='sec')
print(f"Estimated Crack Time: {crack_time_sec} seconds")

# Encrypt the password
encrypted_pass = passencrypt(password, loaded_key)
print(f"Encrypted Password: {encrypted_pass}")

# Decrypt the password
decrypted_pass = passdecrypt(encrypted_pass, loaded_key)
print(f"Decrypted Password: {decrypted_pass}")

# Check if the password is expired (e.g. created 100 days ago)
creation_time = datetime.now() - timedelta(days=100)
expired, status = passexpiration(creation_time)
print(f"Expiration Check: {status}")

# Check if the password is common (e.g. in known data breaches)
is_common, msg = passcommon(password)
print(f"Common Password Check: {msg}")

Metadata

Release files for anythingpassword 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anythingpassword 0.2.3
File Size Uploaded
anythingpassword-0.2.3.tar.gz 485.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anythingpassword 0.2.3
File Interpreter ABI Platform
anythingpassword-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 994.1 kB

Release files / anythingpassword-0.2.3.tar.gz

Download URL anythingpassword-0.2.3.tar.gz
Size 485.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d09b52bbf9734cbacf198c66fe7ab6e8a66e401e6aee8cfb2f9682f2b564f3cb
BLAKE2b-256 checksum
How to use checksums
25dce878cf5d6905a1c1d0c069ae8dfc30c6105f07eae4a9aea2c975c1c42eb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / anythingpassword-0.2.3-py3-none-any.whl

Download URL anythingpassword-0.2.3-py3-none-any.whl
Size 508.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c79cd51cd67e7531be2259ee26f0198080ef0fa62fa0a3482edf7b9e3f7e629
BLAKE2b-256 checksum
How to use checksums
489759a115ae14af9ed21c4ea28917ab81424a6518a42cdbed889dd66dc99130
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page