genkey working, but not for weak keys