Skip to main content

Abstract

authsmith is a unified interface for generating cryptographically strong passwords, passphrases, PINs, recovery codes, usernames and similar user-facing authentication artifacts suitable for managing data such as account authentication, security tokens (GPG keys, disk-encryption) and related secrets.

A short, funny and easy way to understand passphrases can be found at xkcd: Password Strength.


Features

Due to its simplicity, authsmith offers from the start the opportunity to build upon and adapt it to a variety of use cases.

Its flexible architecture ensures support for future development. It has been designed to be adaptable to new requirements while minimizing complete system remake.

authsmith is open source and committed to respect your freedoms, including your freedom to share and change the software (see LICENSE).


Technical Notes

  • programming language: Python 3.13.5
  • version control system: git
  • dependencies: NumPy
  • testing: pytest
  • building and distributing: setuptools
  • documentation: Sphinx
  • audience: software developers

Notable changes in CHANGELOG.


Installation

You can get started with authsmith by installing it from PyPI (recommended). As always, it is best practice to use a virtual environment while you evaluate its features.

Note: How you create and activate a virtual environment is not covered here.

pip install authsmith

Then open a Python session and enter the following commands. A successful installation returns the version number.

import authsmith

print(authsmith.__version__)

Development

Clone the repository to get a local copy of the authsmith source code.

git clone https://codeberg.org/cx2b/authsmith.git

Activate the virtual environment (recommended) and install the package in editable mode.

pip install -e .

Examples

Some introductory examples below (more in the examples directory).

Generate password

from authsmith.models.context import (
    Context
)

from authsmith.services.artifacts import (
    Artifacts
)

context = Context()

context.size = 18

artifacts = Artifacts(context)

random = artifacts.password(lowercase=6, uppercase=6, digits=2, punctuation=-1, ignore="Ol")

result = "".join(random)

print("password:", result)

Calculate entropy

from authsmith.services.artifacts import (
    Entropy
)


def explain_strength(value: int) -> str:
    if value < 28:
        message = "very weak; trivial to crack"
    elif value < 35:
        message = "weak; seconds to minutes to crack"
    elif value < 59:
        message = "moderate; hours to days to crack"
    elif value < 79:
        message = "strong; weeks to months to crack"
    elif value < 127:
        message = "very strong; centuries to crack"
    else:
        message = "excellent cryptographic strength"

    return message


password = "3aSBtW4JrJJEL0qt2p"

randomness = Entropy.shannon_entropy(list(password))
strength = Entropy.combinatorial_entropy(list(password))

print(f"password: {password}")
print(f"randomness: {randomness:.2f}")
print(f"strength: {explain_strength(strength)}")

Next

In no particular order:

  • generate unique random characters
  • generate unique passwords
  • generate PIN codes
  • generate user name as combination of letters and digits
  • generate random hexadecimal codes
  • generate random cryptographically-secure UUID identifiers
  • generate recovery codes
  • generate API keys
  • generate code matrices
  • generate Apple-style, easier to remember passwords
  • generate unique customizable passphrases
  • generate passphrases using the dice method
  • add total length (in characters) as requirement for passphrase generation
  • option to remove words that are considered offensive
  • limits to how long words can be in a passphrase
  • option to mix digits and special characters in passphrases
  • option to mix uppercase and lowercase letters in passphrases
  • calculate entropy (randomness)
  • calculate entropy (strength)
  • generate passwords and passphrases in bulk
  • add Sphinx configuration files

Contributing

Currently, contributing to this project is limited to reporting issues and participating in discussions about feature requests and improvements.

Your feedback is always welcome.


License

authsmith is free software and released under the GNU General Public License version 3 or any later version. Refer to LICENSE for further information about licensing. If not received, see Licenses - GNU Project - Free Software Foundation.



This file is part of authsmith and under the GNU All-Permissive License.

Copyright (C) 2026 Cristian Cezar Botez

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

Metadata

Release files for authsmith 0.0.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 authsmith 0.0.3
File Size Uploaded
authsmith-0.0.3.tar.gz 24.1 kB Details

Built distribution (wheel)

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

Total release size: 48.3 kB

Release files / authsmith-0.0.3.tar.gz

Download URL authsmith-0.0.3.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a81eeac5df9e82435356bca28d4c25edf7d1d398a25df5cfcfd03e891737ce19
BLAKE2b-256 checksum
How to use checksums
70c6a73a5e32d1cae8160a7decbc37e179d0c4315beb4ea66c2ee448b06a68f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / authsmith-0.0.3-py3-none-any.whl

Download URL authsmith-0.0.3-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99043d74d075db16d42829e8e9743dde9185f2da600f279b3b1d0ffb4fb9f291
BLAKE2b-256 checksum
How to use checksums
7ab2a0704f3371d2a165342186760e28019265ac51c4ba0db76e7004b8de9cd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

0.1.0

2 release files

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.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