On windows need to open kay & iv files in binary mode.