Modified generation of key.