Skip to content

go-base32 encoding is broken with no padding and an encoder to io.Writer #62

@MichaelMure

Description

@MichaelMure

For example with b32.NewEncoder(b32.NewEncodingCI("abcdefghijklmnopqrstuvwxyz234567").WithPadding(b32.NoPadding), out), encoding Decentralize everything!!! yield birswgzloorzgc3djpjssazlwmvzhs5dinfxgoijbeeswgzlo instead of birswgzloorzgc3djpjssazlwmvzhs5dinfxgoijbee.

Note the swgzlo suffix, which is taken from the beginning of the encoding buffer, bytes 3 to 8.

This has been fixed upstream (in the go stdlib) with golang/go@10529a0.

To be honest, I don't see the point why go-base32 exist anymore, as the original reason for the fork was to "add option for raw encoding", which exist in the stdlib since golang/go@5f4f751

Maybe go-base32 should be retired entirely?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugA bug in existing code (including security flaws)need/author-inputNeeds input from the original authorneed/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions