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.


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
  • typing: mypy
  • 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

import string

from authsmith import (
    Context,
    Artifacts
)


context = Context()

context.size = 18

artifacts = Artifacts(context)

random: list[str] = artifacts.password(lowercase=6, uppercase=6, digits=2, punctuation=-1, ignore="OIl")

result = "".join(random)

print("password:", result)

Calculate entropy

from authsmith 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 type hints (type annotations, type comments)
  • 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.1.0

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.1.0
File Size Uploaded
authsmith-0.1.0.tar.gz 25.4 kB Details

Built distribution (wheel)

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

Total release size: 50.7 kB

Release files / authsmith-0.1.0.tar.gz

Download URL authsmith-0.1.0.tar.gz
Size 25.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ad17e38379220ddc33955dfa52dd7bcc91d6f79d3dae0efa998911d70cb43ddb
BLAKE2b-256 checksum
How to use checksums
7fe6a962f37e6d849a24b2e43877fd2b00e4e4189ecabba710e85d7bd96dbedc
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.1.0-py3-none-any.whl

Download URL authsmith-0.1.0-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bc6e8ac0a57fa99d7fb27b32b276fd26499ebc60f5ba67390bcda25d6aefeaa
BLAKE2b-256 checksum
How to use checksums
039e100d2f8851bf4fa35f916d8266945dd35d3d2ff24a99b509aebf61fbd287
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

This release

0.1.0 This release

2 release files

0.0.3

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