xor

package
v0.0.0-...-6fab2fb Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindSingleByteCiphertext

func FindSingleByteCiphertext(cts [][]byte) []byte

FindSingleByteCiphertext finds the ciphertext most likely to be single-byte xor'd.

func RecoverRepeatingKey

func RecoverRepeatingKey(ct []byte, a, b int) []byte

RecoverRepeatingKey recovers the key from a repeating-key xor'd ciphertext. It assumes the key size is between a and b inclusive.

It panics if a > b.

TODO: It also panics if 8 * b > len(ct). Fix that.

func RecoverSingleByteKey

func RecoverSingleByteKey(ct []byte) byte

RecoverSingleByteKey recovers the key of a single-byte xor'd ciphertext.

func RecoverSingleBytePlaintext

func RecoverSingleBytePlaintext(ct []byte) []byte

RecoverSingleBytePlaintext recovers the plaintext from a single-byte xor'd ciphertext.

Types

This section is empty.

Jump to

Keyboard shortcuts

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