Source: https://www.enib.fr/~harrouet/Data/Courses/Chiffrement_Authentification.pdf