  In the framework of the generalized Hamiltonian formalism by Dirac, the local
symmetries of dynamical systems with first- and second-class constraints are
investigated in the general case without restrictions on the algebra of
constraints. The method of constructing the generator of local-symmetry
transformations is obtained from the requirement for them to map the solutions
of the Hamiltonian equations of motion into the solutions of the same
equations. It is proved that second-class constraints do not contribute to the
transformation law of the local symmetry entirely stipulated by all the
first-class constraints (and only by them) of an equivalent set passing to
which from the initial constraint set is always possible and is presented. A
mechanism of occurrence of higher derivatives of coordinates and group
parameters in the symmetry transformation law in the Noether second theorem is
elucidated. In the latter case it is shown that the obtained transformations of
symmetry are canonical in the extended (by Ostrogradsky) phase space. It is
thereby shown in the general case that the degeneracy of theories with the
first- and second-class constraints is due to their invariance under
local-symmetry transformations. It is also shown in the general case that the
action functional and the corresponding Hamiltonian equations of motion are
invariant under the same quasigroup of local-symmetry transformations.
