crack

package
v0.0.0-...-3d71b91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NumberOfWorkers = 32
)

Variables

This section is empty.

Functions

func ComplementedMnemonics

func ComplementedMnemonics(s MnemonicSettings) <-chan *aezeed.Mnemonic

ComplementedMnemonics iterates over all possible mnemonics that complete the given partial mnemonic -- unvalidated.

func FindMissingWords

func FindMissingWords(s MnemonicSettings, callback func(progress Result))

func FindSwappedWords

func FindSwappedWords(s MnemonicSettings, callback func(progress Result))

func FindWrongWord

func FindWrongWord(s MnemonicSettings, callback func(progress Result))

FindWrongWord finds a single wrong word in the mnemonic.

Types

type Indexer

type Indexer interface {
	Done() bool
	Increment() Indexer
	Apply([]string) *aezeed.Mnemonic
}

Indexer is an interface for iterating over the search space of an incomplete or wrong mnemonic. (Named Indexer for lack of a better word).

type InsertIndexer

type InsertIndexer struct {
	// contains filtered or unexported fields
}

InsertIndexer is used to keep track of multiple insertion- and word indices when complementing a mnemonic.

func NewInsertIndexer

func NewInsertIndexer(s MnemonicSettings, n int) *InsertIndexer

NewInsertIndexer creates an Indexer for n amount of missing words.

func (*InsertIndexer) Apply

func (i *InsertIndexer) Apply(xs []string) *aezeed.Mnemonic

Apply returns a new mnemonic with the missing words inserted at the positions according to the indexer.

func (*InsertIndexer) Done

func (i *InsertIndexer) Done() bool

Done returns true if the indexer has reached the end of the search space.

func (*InsertIndexer) Increment

func (i *InsertIndexer) Increment()

Increment forwards the current position by the following rules: If the last sub-indexer's current word index is less than 2047, increment it. If the last sub-indexer's current word index is 2047, and the current position is less than 23, increment the current position and reset the word index. If the last sub-indexer's current word index is 2047, and the current position is 23, increment the second to last sub-indexer according to the same rules, and reset the last sub-indexer.

type MnemonicSettings

type MnemonicSettings struct {
	Wordlist       []string
	Password       string
	Mnemonic       []string
	MnemonicLength int
}

type Result

type Result struct {
	Trials     Trials
	Password   string
	CipherSeed *aezeed.CipherSeed
	Highlight  []int
}

func (Result) Exhausted

func (r Result) Exhausted() bool

type Trials

type Trials struct {
	Start time.Time
	Total int
	Tried int
}

func (*Trials) Elapsed

func (t *Trials) Elapsed() time.Duration

func (*Trials) Percentage

func (t *Trials) Percentage() float64

func (*Trials) Remaining

func (t *Trials) Remaining() time.Duration

type WorkerPool

type WorkerPool struct {
	Workers []*worker
	Out     chan *aezeed.CipherSeed
	// contains filtered or unexported fields
}

func NewWorkerPool

func NewWorkerPool(n int, password string) *WorkerPool

NewWorkerPool creates a pool of size n to distribute mnemonic seed validation.

func (*WorkerPool) Close

func (pool *WorkerPool) Close()

Close shuts down pool and all of its workers.

func (*WorkerPool) Consume

func (pool *WorkerPool) Consume(in <-chan *aezeed.Mnemonic)

Consume reads mnemonics from channel and distributes them round-robin to its workers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL