bug 964: Completely reimplement the IE key generation