otp

Erlang rb module

When looking up messages in a sasl log using rb:list() or rb:show(), rb seems to dump the output in the console and return 'ok'; is there any way to configure rb to get it to return the actual log message ? Thanks ...

erlang OTP Supervisor crashing

I'm working through the Erlang documentation, trying to understand the basics of setting up an OTP gen_server and supervisor. Whenever my gen_server crashes, my supervisor crashes as well. In fact, whenever I have an error on the command line, my supervisor crashes. I expect the gen_server to be restarted when it crashes. I expect comm...

Cannot spawn an erlang supervisor from the shell.

I've implemented a gen_server and supervisor: test_server and test_sup. I want to test them from the shell/CLI. I've written their start_link functions such that their names are registered locally. I've found that I can spawn the test_server from the command line just fine, but a spawned test_sup does not allow me to interact with the s...

[ERLANG] Priority send and receive

I have a problem that I wonder if it can be efficiently implemented in ERLANG. I have a bunch of nodes communicating with each other using a protocol that adds priority information to messages. I would like to be able to send the highest priority messages first (at the sender) and handle them first at the receiver, before the lower-prio...

starting remote erlang nodes

hi guys, I want to write a master-slave application in Erlang. I am thinking at the following things I need from the architecture: the slaves shouldn't die when the master dies, but rather try to reconnect to it while the master is down the master should automatically start the remote nodes if they don't connect automatically or they a...

What else do I need to know about implementing a one-time-password system?

I've been tasked with creating a One Time Password (OTP) system which will eventually be used to create OTP generators on mobile devices. We're looking at using HOTP (rfc 4226) using a counter, but maybe with some variations. We are not required to be OATH compliant. This is my first experience in the security/cryptographic realm, so ...

Secret keys differ between Android and server

I'm working on a one-time password application, using the hotp algorithm (RFC 4226). I've got an Android app (via simulator) for otp generation, and a server-side app for validation. On their own, both are working fine and passing tests. However, the secret key I'm generating on my device is not the same as the secret key I'm generati...

Erlang application launch on a Windows server

I have an Erlang application that is deployed on a server with Windows Server 2008. The way I do this: Copy application folder in Erlang lib directory. Open command line (cmd). Execute erl. Execute application:start(app_name) in Erlang shell. Are there any better approaches to launch the application? How to make the application to l...

Generate secret code for password reset

I'm doing a module which allow users to reset password. I noticed how most websites they provide a confirmation link which contain query string that has a unique hash. My question is: How can I generate this unique hash each time the same user request forgot password? Should I store this hash in database and use it for verification late...

Erlang/OTP framework's error_logger hangs under fairly high load

My application is basically a content based router which will route MMS events. The logger I am using is the one that comes with the OTP framework in SASL mode "*error_logger*" The issue is :: I am using a client to generate MMS events with default values. This client (in Java) has the ability to send high load of events in multiple T...

OTP/XOR Cracking two ciphertexts that have the same key

How can I crack two ciphertexts that have used the same key twice? For example, plaintext1 uses the key "abcdefg", and plaintext2 uses the key "abcdefg". I know that ciphertext2 ^ ciphertext1 is equal to plaintext1 ^ plaintext2. And the method to crack plaintext1 ^ plaintext2 is the same method to crack a "book cipher" (also sometimes c...

Ensuring an event is handled while switching gen_event handlers in Erlang/OTP

Let's say I have several versions of a gen_event handler and want to change them around while the program is running: -module(logger_all). -behaviour(gen_event). -export([init/1, handle_event/2, terminate/2]). init(_Args) -> {ok, []}. handle_event({Severity, ErrorMsg}, State) -> io:format("***~p*** ~p~n", [Severity, ErrorMsg]), ...

Supervisors with backoff

I have a supervisor with two worker processes: a TCP client which handles connection to a remote server and an FSM which handles the connection protocol. Handling TCP errors in the child process complicates code significantly. So I'd prefer to "let it crash", but this has a different problem: when the server is unreachable, the maximum ...

Can I handle any received message in gen_fsm state callbacks?

I noticed that messages sent to the pid of a gen_fsm process are matched in the state callbacks as events. Is this just accidental or can I rely on this feature? Normally I would expect general messages sent to a gen_fsm to show up in the handle_info/3 callback and thought I would have to re-send it using gen_fsm:send_event. Does gen_...

How to design a flexible Erlang protocol stack creation API

Unsatisfied with my current approach I'm just trying to redesign the way I build protocol stacks in Erlang. The feature ordered by importance: Performance Flexibility and implementation speed adding new protocol variants It would help development to explore the protocol variants from the shell My current model (alreday described in ...