Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Seed.random should not generate seeds longer than 81 trytes #44

@todofixthis

Description

@todofixthis

Seed.random generates 82-tryte seeds by default. However, beyond 81 trytes, you can't increase the security of your seed — not even against brute force attacks (see Why aren't seeds longer than 81 trytes more secure? for more info).

Using urandom to generate random bytes is a clever approach, but because we have to translate bytes into trytes, we are limited to generating even numbers of trytes. An alternate approach is needed.

Modify Seed.random so that it generates exactly 81 trytes each time:

  • Remove the length argument.
  • Use a different method of generating random trytes (see http://stackoverflow.com/a/2257449/ for some ideas — note that using a CSPRNG is mandatory!).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions