More than one century after their discovery, the origin of cosmic rays remains one of the most important open questions in astrophysics. They are detected as a flux of charged particles, mainly protons and light nuclei, reaching extremely high energies (up to around 10^20 eV). The detection of cosmic rays implies the existence of efficient particle accelerators in the Universe.