improved keywordcipher performance