Skip to content
This repository was archived by the owner on Jul 15, 2018. It is now read-only.
This repository was archived by the owner on Jul 15, 2018. It is now read-only.

Seed phrase has same last word when create a new key #116

@chengwenxi

Description

@chengwenxi

When I create a new key, it will return seed phrase with the same last word every time.
This should be caused by keybase.go#50,

typ := cryptoAlgoToByte(algo)
secret = append([]byte{typ}, secret...)

secret[0] is invariable, when BytesToWords, because of secret.length = 21 and words.length = 2048(2^11), the last word index = f(secret.bits[21 * 8-11 * 15]) = f(secret.bits[3]) = f(secret[0].bits[0,2]),is also invariable.

typ := cryptoAlgoToByte(algo)
secret = append(secret, []byte{typ}...)
will avoid it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions