package encoders

// structure representing an XOR encoder. this will carry
// out all the functions related to XOR encoding/encrypting.
type XOREncoder struct {
	// ciphertext generated by the encoder based on the key
	// and plaintext. this is the encrypted data.
	Ciphertext string

	// key used to encrypt the plaintext data and generate
	// the ciphertext.
	//
	// note: this should be the hexidecimal representation
	// of the ascii characters. if the key is "hello", the
	// value of key should be "68656c6c6f".
	key []byte

	// offset used when encrypting. this will determine the
	// start position within the key.
	keyoffset int

	// plaintext data to encrypt. this is human-readable and
	// the data that needs to be protected.
	plaintext string
}

// structure representing an OptsStruct that will hold the
// configuration options for an XOREncoder object.
type XOREncoderOptions struct {
	// file that contains plaintext to encrypt. this will be
	// read by the encryptor and the plaintext wil be extracted.
	//
	// note: this cannot be set alongside Plaintext.
	PlaintextFile string

	// this is the plaintext that will be encrypted using the
	// XOREncoder object.
	//
	// note: this cannot be set alongside PlaintextFile.
	Plaintext string

	// file that contains the key used for encryption. this will
	// be read by the encryptor and the key will be extracted
	// and used for encoding/encryption.
	//
	// note: this cannot be set alongside Key.
	KeyFile string

	// key that will be used in encoding/encryption.
	//
	// note: this cannot be set alongside KeyFile.
	Key []byte

	// offset that will be used when encrypting. this will determine
	// the start position within the key.
	KeyOffset int
}
