lex Haro An algorithm to generate canonical transformations: application to normal forms. (2626K, Zipped LaTeX 2e with 5 PS Figures and 4 EPS figures) ABSTRACT. We describe a new method to generate symplectic diffeomorphisms. This method is based on primitive functions. We apply the algorithm to the construction of normal forms of KAM tori. A concrete application, developed in detail and implemented numerically, is normal forms near invariant circles.