\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{%
  shapes.symbols,shapes.callouts,%
  decorations.pathreplacing,positioning,calc}
\tikzset{
  mugshot/.style = {draw, fill = white, inner sep = 0, outer sep = \jot},
  thought/.style = {
    shape = cloud callout, cloud ignores aspect, draw, fill = white,
    cloud puffs = 20, cloud puff arc = 110,
    callout absolute pointer = (#1)
  },
  box/.style = {draw, minimum size = 16pt, fill = #1},
  op/.style = {box = #1, shape = circle},
  rounded/.style = {rounded corners = 2mm},
  offset/.style = {transform canvas = {shift = {#1}}},
  > = stealth
}

\begin{document}

      \begin{tikzpicture}[node distance = 5mm]
        \node[box = yellow!20, minimum width = 30mm] (m) {$m$};
          \node[op = red!20, below = of m] (enc) {$E$}
            edge[<-] (m);
          \coordinate[below = of enc] (p);
          \node[box = red!20, minimum width = 30mm + 15pt, below = of enc]
            (c) {$c$}
            edge[<-] (enc);
          \node[box = green!20, right = -0.6pt of c] (sig) {$\sigma$};
          \node[box = blue!20, left = -0.6pt of c] (u) {$u$};
          \node[op = green!20, above = 10mm] at (sig |- m) (s) {$S$}
            edge[->] (sig);
          \node[above = of s] {$a'$} edge[->] (s);
          \draw[->] (s |- enc) -- (enc);
          \node[box = green!20, left = 25mm of s, below] (t2) {$\tau$};
          \node[box = blue!20, above = -0.6pt of t2] (b2) {$B$};
          \draw[decorate, decoration = brace]
            (b2.north east) -- (t2.south east)
            coordinate[pos = 0.5, right = 2.5pt] (sm) edge[->] (s);
          \node[box = green!20, left = of t2] (tag) {$\tau$} edge[->] (t2);
          \node[box = red!20, left = -0.6pt of tag] (k) {$K$};
          \draw[rounded, ->] (k) |- (enc);
          \draw[decorate, decoration = brace]
            (k.north west) -- (tag.north east)
            coordinate[pos = 0.5, above = 2.5pt] (z);
          \node[op = blue!20, above = 8mm of z] (kem) {$\mathcal{E}$}
            edge[->] (z);
          \draw[rounded, ->] (kem) -| +(-10mm, -8mm) |- (u);
          \node at (kem -| b2) {$B$} edge[->] (kem) edge[->] (b2);
      \end{tikzpicture}

\end{document}
