Let G and H be subgroups of a finite p-group of permutations. We describe the theory and implementation of a polynomial-time algorithm for computing the normalizer of H in G. The method employs the imprimitivity structure and an associated canonical chief series to reduce to linear problems with fast solutions. An implementation in GAP exhibits marked speedups over general-purpose methods applied to the same groups. There are analogous procedures and timings for the problem of testing conjugacy of subgroups of p-groups, and implementations are planned. It is an easy matter, also, to extend the application to general nilpotent groups.