Added an option to generate a key with a specific size.