Fixed the EOF bug by moving to prepending size of the text.
It is prepended after encryption and consumed before decryption, which saves time on the decryption by note decrypting lots more junk data. But, the disadvantage of this is that it puts an unsigned int's 4 bytes of size data into the front of the cipher text. This is a security risk and a fairly easily recognizable pattern. I could split the 4 bytes and sprinkle them at certain offsets into the cipher text, though I'm not sure that's any wiser. Still need to add the command line option to pass the encryption key.