A torque sensor having a sensor element, wherein the sensor element is manufactured in accordance with the manufacturing steps of applying a first current pulse to the sensor element, wherein the first current pulse is applied such that there is a first current flow in a first direction along a longitudinal axis of the sensor element, wherein the first current pulse is such that the application of the current pulse generates a magnetically encoded region in the sensor element.