<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 27, 2015 at 12:50 PM, Frans Schneider <span dir="ltr"><<a href="mailto:schneider@xs4all.nl" target="_blank">schneider@xs4all.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1ob" class="a3s" style="overflow:hidden">I am implementing a kind of IM proxy which currently handles one single session for one user. The session is implemented as a stack of processes with from top to bottom the session control process, a stanza encoder / decoder process, an en- / decrypt process and finally a process which handles the tcp connection. Each process is a FSM and holds state such as <span class="il">RC4</span> encryption state, tcp data etc. The session is controlled by a supervisor which is part of a overall supervisor structure. A session will be open for a long period.</div></blockquote></div><br>Two immediate hunches from this:</div><div class="gmail_extra"><br></div><div class="gmail_extra">* Do you actually need a process chain? You can still write code in modules and chain them together, keeping state separate. But without spawning new processes. Unless you can a distinct advantage where the processes need to do things on their own, it is probably easier to keep them together.</div><div class="gmail_extra">* RC4 is broken. Do never ever use it for anything, please. Pick xsalsa20 or chacha20, both derived from the Salsa20 cipher. Or something else. The cryptographic community is widely believing adversaries are able to break RC4, which means it is a ticking bomb for anyone using it.<br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">J.</div>
</div></div>