[erlang-questions] Implement parallel sessions

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Wed Jan 28 18:47:26 CET 2015


On Tue, Jan 27, 2015 at 12:50 PM, Frans Schneider <schneider@REDACTED>
wrote:

> 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
> RC4 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.
>

Two immediate hunches from this:

* 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.
* 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.


-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150128/d3a92387/attachment.htm>


More information about the erlang-questions mailing list