Documentation
¶
Index ¶
- func AvailableEncodings() []string
- func AvailableHashes() []string
- func RecodeInput(encodings []string, r io.Reader, decode bool, verbose bool) ([]byte, error)
- type AppInputData
- type Calculator
- type Coder
- type Dictionary
- type Hasher
- func (h *Hasher) Algo(algo string)
- func (h *Hasher) AllowedKeys(s string)
- func (h *Hasher) ExpectedHash(expected string)
- func (h *Hasher) FindRandom() (string, error)
- func (h *Hasher) FindSequential() (string, error)
- func (h *Hasher) GetAllowedKeys() string
- func (h *Hasher) Length(len int)
- func (h *Hasher) MaxLength(len int)
- func (h *Hasher) MinLength(len int)
- func (h *Hasher) Prefix(s string)
- func (h *Hasher) Reverse(b bool)
- func (h *Hasher) Suffix(s string)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvailableEncodings ¶
func AvailableEncodings() []string
AvailableEncodings returns the available encoding id's
func AvailableHashes ¶
func AvailableHashes() []string
AvailableHashes returns the available hash id's
Types ¶
type AppInputData ¶
AppInputData is the captured input to the app, either from a pipe or a file
func ReadPipeOrFile ¶
func ReadPipeOrFile(fileName string) (*AppInputData, error)
ReadPipeOrFile reads from stdin if pipe exists, else from provided file
type Calculator ¶
type Calculator struct {
// contains filtered or unexported fields
}
Calculator is used to calculate hash of input cleartext
func NewCalculator ¶
func NewCalculator(reader io.Reader) *Calculator
NewCalculator creates a new Calculator
Example ¶
r := strings.NewReader("hello world") calc := NewCalculator(r) h, _ := calc.Sum("sha1") fmt.Printf("%x", h)
Output: 2aae6c35c94fcfb415dbe95f408b9ce91ee846ed
type Coder ¶
type Coder struct {
// contains filtered or unexported fields
}
Coder is used to encode and decode various binary-to-text encodings
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
Dictionary is used to find cleartext for checksum in `expected`, using dictionary and any algorithm with matching bitsize
func NewDictionary ¶
func NewDictionary(dictFileName string) (*Dictionary, error)
NewDictionary creates a new Dictionary
func (*Dictionary) ExpectedHash ¶
func (d *Dictionary) ExpectedHash(expected string)
ExpectedHash sets the expected hash
type Hasher ¶
type Hasher struct {
// contains filtered or unexported fields
}
Hasher is used to find cleartext for checksum in `expected`, using algorithm in `algo`
func (*Hasher) AllowedKeys ¶
AllowedKeys sets the allowed keys
func (*Hasher) ExpectedHash ¶
ExpectedHash sets the expected hash
func (*Hasher) FindRandom ¶
FindRandom uses random brute force to attempt to find by luck
func (*Hasher) FindSequential ¶
FindSequential calcs all possible combinations of keys of given length
func (*Hasher) GetAllowedKeys ¶
GetAllowedKeys returns the allowed keys