Documentation
¶
Overview ¶
Package cipher contains implementations of various toy ciphers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func A1Decode ¶
A1Decode decodes a number in the range [1-26] using the A=1, ..., Z=26 substitution cipher.
func A1Encode ¶
func A1Encode[T constraints.Integer](n T) int
A1Encode encodes a rune in the range [A-Za-z] using the A=1, ..., Z=26 substitution cipher.
func CBF ¶
CBF encodes a string into a slice of integers. CBF encoding is similar to A1Encode, but done mod 10.
func KeywordToMatrix ¶
Types ¶
type FourSquare ¶
type FourSquare struct {
// contains filtered or unexported fields
}
1 2 4 3
func NewFourSquare ¶
func NewFourSquare(key1, key2 string, horizontal bool) *FourSquare
NewFourSquare creates a new four square cipher instance. GC49KY3 uses horizontal = false. CacheSleuth uses horizontal = true.
func (*FourSquare) String ¶
func (f *FourSquare) String() string
type SixSquare ¶
type SixSquare struct {
// contains filtered or unexported fields
}
func NewSixSquare ¶
Click to show internal directories.
Click to hide internal directories.