Keys are used to prevent relative rotation between circular shafts and mating parts. Common types include square, feather, woodruff, and gib head keys. Key design considers the shear and compressive stresses on the key and mating parts. The key length is calculated based on the torque transmitted, shaft diameter, key dimensions, and allowable stresses of the materials. Safety factors of 1.5-4.5 are used depending on the load conditions. Examples show calculating key dimensions, transmitted torque, and horsepower based on given shaft properties and design stresses.