Rewind key file each time before encode/decode

Fixes #6