Skip to content

Smart Passwords Library (smartpasslib) v2.0.0

Choose a tag to compare

@smartlegionlab smartlegionlab released this 05 Dec 02:14
· 34 commits to master since this release
d52e51f

Smart Passwords Library (smartpasslib) v2.0.0

🔄 What's New in v2.0.0

⚠️ CRITICAL WARNING!: Upgrading to v2.0.0 will break all existing password generation. All passwords generated with v1.x will become invalid, and public keys will no longer verify. This is not a compatible upgrade - it completely changes the cryptographic foundation.

Major Changes:

API Simplification:

  • Removed login parameter from all methods - now uses only secret phrase
  • Simplified SmartKeyGenerator to work with single secret parameter
  • Removed SmartPasswordMaster.generate_default_smart_password() method

Data Model Updates:

  • SmartPassword class updated: login → description, key → public_key
  • All deprecated methods removed (not just marked as deprecated)
  • Removed deprecated file_path property from SmartPasswordManager

Security Improvements:

  • Simplified key derivation algorithm in SmartKeyGenerator
  • Cleaner seed management in SmartPasswordGenerator
  • Removed complex hash mixing from v1.x

Testing & Quality:

  • 100% test coverage achieved
  • Comprehensive exception testing added
  • Improved test fixtures and data management

Breaking Changes:

Method Signature Changes:

# v1.x → v2.0
SmartPasswordMaster.generate_smart_password(login, secret, length)
SmartPasswordMaster.generate_smart_password(secret, length)

SmartPasswordMaster.generate_public_key(login, secret)
SmartPasswordMaster.generate_public_key(secret)

SmartPasswordMaster.check_public_key(login, secret, public_key)
SmartPasswordMaster.check_public_key(secret, public_key)

Class Structure Changes:

# v1.x → v2.0
SmartPassword(login, key, length)
SmartPassword(public_key, description, length)

SmartKeyGenerator._create_key(login, secret, steps)
SmartKeyGenerator._create_key(secret, steps)

Removed Methods:

  • SmartPasswordManager.add() → use add_smart_password()
  • SmartPasswordManager.get_password() → use get_smart_password()
  • SmartPasswordManager.remove() → use delete_smart_password()
  • SmartPasswordManager.load_file() → internal _load_data()
  • SmartPasswordManager.save_file() → internal _write_data()
  • SmartPasswordManager.file_path → use filename
  • SmartPasswordMaster.generate_default_smart_password()

Migration Guide:

Password Generation:

# v1.x
password = SmartPasswordMaster.generate_smart_password(
    login="service", 
    secret="mysecret", 
    length=12
)

# v2.0
password = SmartPasswordMaster.generate_smart_password(
    secret="mysecret", 
    length=12
)

SmartPassword Creation:

# v1.x
sp = SmartPassword(
    login="GitHub", 
    key=public_key, 
    length=16
)

# v2.0
sp = SmartPassword(
    public_key=public_key,
    description="GitHub", 
    length=16
)

Manager Operations:

# v1.x (deprecated methods)
manager.add(password)
manager.get_password("login")

# v2.0
manager.add_smart_password(sp)
manager.get_smart_password(public_key)

Key Improvements:

  1. Simplified API - Single secret parameter instead of login + secret
  2. Cleaner Code - Removed all deprecated methods and legacy code
  3. Better Security - Streamlined cryptographic operations
  4. Full Test Coverage - 100% test coverage ensures reliability
  5. Clearer Naming - public_key accurately represents verification key

Note: v2.0.0 is not backward compatible with v1.x. Update your code according to the migration guide.

Full Changelog: 1.2.1...v2.0.0