This paper describes how to verify cryptographic protocols by a general-purpose program transformation technique with unfolding. The questions of representation and analysis of the protocols as prefix rewriting grammars are discussed. In these aspects Higman and Turchin embeddings on computational paths are considered, and a refinement of Turchin's relation is presented that allows to algorithmically decide the empty word problem for prefix rewriting grammars.