Documentation ¶
Index ¶
- Variables
- func AppendTrigraphByteByKey(writeTo *[]byte, character *byte, key *[]byte, keyIndex *int) error
- func TrigraphByte(writeTo *byte, x *byte, y *byte) error
- func TrigraphRune(writeTo *rune, x *rune, y *rune) error
- func ZeroKeyByte(writeTo *byte, character *byte) error
- func ZeroKeyRune(writeTo *rune, character *rune) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrNilPointer = errors.New("received nil pointer(s)") ErrOutOfRange = errors.New("input X and Y must be between A and Z") ErrNegativeKeyIndex = errors.New("key index can not be negative") ErrKeyIndexOutOfBounds = errors.New("key index is out-of-bounds") )
var ReciprocalTable string
Functions ¶
func AppendTrigraphByteByKey ¶
AppendTrigraphByteByKey will append the encoded character to a byte slice tracking an indexed key. It will also increment the index through the keyIndex pointer when done making it possible to call this function repeatedly per input character. You will have to check that the index is not out of range, function will fail if index is greater than the length of the byte slice. You should also ensure the the byte slice (pointing at by writeTo) has the desired capacity in order to prevent the append function to make a new slice and copy everything from the old slice, thus leaving traces of encrypted text in memory that you are unable to wipe by yourself.
func TrigraphByte ¶
TrigraphByte writes the trigraph of input X and Y (where X is usually the row and Y is the column, but this does not matter). Pointers are used in the effort to prevent anything from the input being copied. Krypto431 wipes it's data structures and if there would be copies elsewhere it would be in vain.
func TrigraphRune ¶
TrigraphRune is the rune implementation of TrigraphByte. See TrigraphByte for information.
func ZeroKeyByte ¶
ZeroKeyByte returns a "zero" encryption letter (byte) key in order to trigraph-encode an input letter to the same output letter (which makes the plaintext same as the ciphertext, effectively a zero key in a standard Vigenere cipher).
func ZeroKeyRune ¶
ZeroKeyRune returns a "zero" encryption letter (rune) key in order to trigraph-encode an input letter to the same output letter (which makes the plaintext same as the ciphertext, effectively a zero key in a standard Vigenere cipher).
Types ¶
This section is empty.