Rewriting tools/unvigenere in C