Skip to content

Base64StringKeyGenerator should not have a minimum length #17012

Open
@OrangeDog

Description

@OrangeDog

Expected Behavior

As with all other StringKeyGenerators and BytesKeyGenerators, developers should be free to choose an output length as small as they wish.

Current Behavior

Throws IllegalArgumentException if keyLength is less than 32.

Context

I want to generate random keys that are reasonably easy for humans to transcribe.
Base64 provides a good balance of usable character set and entropy per character.

However, this forces a minimum of 43 characters (⌈ 32 * 4/3 ⌉), which is unreasonable for human use.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions