The presence of crack-like defects in mechanical and structural elements produces failures during their service life that in some cases can be catastrophic. So, the early detection of the fatigue cracks is particularly important because they grow rapidly, with a propagation velocity that increases exponentially, and may lead to long out-of-service periods, heavy damages of machines and severe economic consequences. In this work, a non-destructive method for the detection and identification of elliptical cracks in shafts based on stress wave propagation is proposed. The propagation of a stress wave in a cracked shaft has been numerically analyzed and numerical results have been used to detect and identify the crack through the genetic algorithm optimization method. The results obtained in this work allow the development of an on-line method for damage detection and identification for cracked shaft-like components using an easy and portable dynamic testing device.