🔐 Password Generator API - Complete Guide

API Overview

Base URL: http://localhost:8080/api/v1
All password generation uses cryptographically secure random number generation for maximum security.

🔐 High Entropy Generator

Cryptographically secure random passwords with full character set control.

Purpose & Use Case

Generate traditional random passwords with complete control over character types. Best for systems requiring specific character set compliance or when you need maximum randomness.

Available Options

number16length

Range: 8-128 characters

Description: Total password length. Longer passwords provide exponentially more security.

Security Impact: Each additional character roughly doubles the time required to crack the password.

booleantrueinclude_uppercase

Description: Include uppercase letters (A-Z) in the character set.

Character Set: ABCDEFGHIJKLMNOPQRSTUVWXYZ (26 characters)

Security Impact: Adds 26 possible characters, significantly increasing entropy.

booleantrueinclude_lowercase

Description: Include lowercase letters (a-z) in the character set.

Character Set: abcdefghijklmnopqrstuvwxyz (26 characters)

Note: At least one character type must be selected.

booleantrueinclude_numbers

Description: Include numeric digits (0-9) in the character set.

Character Set: 0123456789 (10 characters)

Compliance: Required by many corporate password policies.

booleantrueinclude_symbols

Description: Include special symbols in the character set.

Character Set: !@#$%^&*()_+-=[]{}|;:,.<>? (25 characters)

Note: Some systems have restrictions on certain symbols. Validate accepted characters in your target environment.

Example Request

POST /api/v1/passwords/generate Content-Type: application/json { "type": "high-entropy", "count": 2, "options": { "length": 20, "include_uppercase": true, "include_lowercase": true, "include_numbers": true, "include_symbols": false } }

Example Response

{ "success": true, "data": { "passwords": [ "Km9xB3nQ2pL8vR5wE6sA", "T7gY4hJ9kM1nP6qU8zC3" ], "entropy_bits": 119.5, "generator_info": "High entropy generator with alphanumeric characters", "options_used": { "length": 20, "include_uppercase": true, "include_lowercase": true, "include_numbers": true, "include_symbols": false } }, "message": "Generated 2 password(s) of type 'high-entropy'", "timestamp": "2025-08-23T21:24:00+02:00" }

🗣️ XKCD Pass Generator

Memorable passphrases using word combinations with multilingual support.

Purpose & Use Case

Generate memorable passphrases based on the famous XKCD comic "Password Strength". Ideal when users need to remember passwords without writing them down. Supports multiple languages for international users.

Available Options

number4words

Range: 3-8 words

Description: Number of words in the passphrase.

Security Impact: Each additional word exponentially increases security. 4 words ≈ 52 bits, 6 words ≈ 77 bits entropy.

Memorability: 4-5 words strike the best balance between security and memorability.

selectenwordlist

Options: en, de, de_CH, fr, it, es, pt, ja, zh

Description: Wordlist to use for generation.

Wordlist Quality: Built-in curated collections are selected per language and can be checked dynamically from the wordlist endpoint.

Availability: Check /api/v1/passwords/wordlists for current language availability.

text-separator

Description: Character(s) used to separate words in the passphrase.

Single Character: All separations use the same character (e.g., "word-word-word").

Multiple Characters: Each separation randomly selects from the character set (e.g., "word-word_word.word").

Space Handling: Spaces are excluded from multi-character separator sets for security.

Examples: "-", "_", ".", "-_.", "!@#"

booleanfalseadd_number

Description: Add a 2-digit number to the passphrase.

Security Benefit: Increases entropy by ~6.6 bits (100 possible values).

Position Control: Use number_position to control placement.

selectendnumber_position

Requires: add_number: true

Options:

  • beginning: "42-word-word-word"
  • end: "word-word-word-42"
  • random: "word-42-word-word" (random separator position)

Security Note: Random position provides additional unpredictability.

Example Request

POST /api/v1/passwords/generate Content-Type: application/json { "type": "xkcdpass", "count": 1, "options": { "words": 5, "wordlist": "en", "separator": "-_.", "add_number": true, "number_position": "random" } }

Example Response

{ "success": true, "data": { "passwords": ["horse-battery_42.correct_staple"], "explanations": ["large four-legged animal – device that stores electrical energy – free from error; accurate – basic or principal item"], "entropy_bits": 58.7, "generator_info": "XKCD-style passphrase using 5 words from en wordlist", "options_used": { "words": 5, "wordlist": "en", "separator": "-_.", "add_number": true, "number_position": "random" } }, "message": "Generated 1 password(s) of type 'xkcdpass'", "timestamp": "2025-08-23T21:24:00+02:00" }

🔒 Security Recommendations

Choosing the Right Generator

  • High Entropy: Maximum security with strict policy control
  • XKCD Pass: User memorability, multi-language support needed
  • Diceware: Maximum security with educational value
  • PWGen: Pronounceable passwords with balanced strength and usability
  • Passkey: Pronounceable passwords for verbal communication

Entropy Guidelines

  • 50+ bits: Basic security (personal accounts)
  • 65+ bits: Strong security (business accounts)
  • 80+ bits: Excellent security (high-value accounts)