extend random generation for length of key