[Tex/LaTex] TikZ or cryptocode package for cryptographic protocol diagrams

diagramspdftextikz-pgf

I am using cryptocode package to make a protocol of 4 players.

\fbox{
\procedure{name}{%
 \textbf{Alice}  \< \textbf{Verisign}  \< \textbf{Eve}  \< \textbf{Bob} \\
\sendmessageright{top=\text{hello}} \<\\
\<\sendmessageright{top=\text{hello}} \<\\
\<\<\sendmessageright{top=\text{hello}} \<\\
 }
 }

I think it is very complex package with no clear documentation. I am writing to ask from experts if it is better to stick to cryptocode or to use TikZ for such diagrams.
And if any one can help me with this example using TikZ i would appreciate it 🙂
thanks
enter image description here

Best Answer

Do you know msc package? It was developed to include Message Sequence Charts. (Note: you should compile with XeLaTeX) Your example looks:

enter image description here

\documentclass{article}
\usepackage{msc}

\begin{document}

\drawframe{no}
\begin{msc}{name}
    \declinst{A}{}{Alice}
    \declinst{B}{}{Verisign}
    \declinst{C}{}{Eve}
    \declinst{D}{}{Bob}
    \mess{hello}{A}{B}
    \nextlevel
    \mess{hello}{B}{C}
    \nextlevel
    \mess{hello}{C}{D}
\end{msc}

\end{document}

As an alternative you could use TikZ. With tikzpeople you can introduce some fun to all these serious protocols.

enter image description here

\documentclass[tikz, border=2mm]{standalone}

\usepackage{lmodern, tikzpeople}
\usetikzlibrary{positioning, shapes.multipart}

\begin{document}

\begin{tikzpicture}[people/.style={minimum width=1.5cm}]
\node[people, alice] (alice) {Alice};
\node[people, priest, right=of alice] (vs) {Verisign};
\node[people, nun, right=of vs] (eve) {Eve};
\node[people, bob, right=of eve] (bob) {Bob};

\draw[->] ([yshift=-1cm]alice.south) coordinate (l1)--(l1-|vs) node[midway, above]{Hello};
\draw[->] ([yshift=-1.5cm]vs.south) coordinate (l2)--(l2-|eve) node[midway, above]{Hello};
\draw[->] ([yshift=-2cm]eve.south) coordinate (l3)--(l3-|bob) node[midway, above]{Hello};
\end{tikzpicture}

\end{document}