I've fixed encrypt_key.c to follow the rules when encrypting stuff, so it should stop over-writing the end of allocated space.