CFB.encrypt

ubyte[] encrypt(const(ubyte)[] input)

Encrypts data using CFB mode.

CFB encryption:

  1. Encrypt the shift register to produce output block
  2. XOR plaintext segment with MSB of output block
  3. Shift ciphertext into the shift register

A trailing partial segment shorter than the segment size is processed with the most significant bits of the output block and is not fed back (NIST SP 800-38A, Section 6.3).

Parameters

inputPlaintext to encrypt. The final segment may be a partial one of any non-zero byte length.

Returns

Ciphertext of the same length as input.