Demonstration code for BarCamp talk on Erlang concurrent processing
Erlang Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
presentation
ruby
.gitignore
LICENSE
README
SETUP
bench.erl
dist.erl
misc.erl
pwd.erl
test_pwd.erl

README

2008-12-09:  Added dist.erl for distributed demo

Module pwd.erl contains the main algorithms and is sufficient for testing on a single multicore computer.
Module dist.erl adds some very simple functions for distributing across multiple computers.  A more
robust system should use a library like OTP instead.  

Instructions for distributed server and clients:

1.  It's critical that the server is accessible by all clients using a fully qualified domain name (IP addr won't work) or you will encounter badrpc errors.  This is a "feature" of Erlang.

2.  Start the server session, setting a name and cookie (these can be anything you want)

erl -name anyname@fullyqualified.com -setcookie abcd

3.  Start the client(s) using a unique name for each but the same cookie

erl -name iamaclient -setcookie abcd

4.  To ensure the client can see the server correctly, you can test via net_adm

> net_adm:ping(aserver@fullyqualified.com).

If it says "pong", you're set, but if it says "pang", the connection failed.  

5.  Start the master password controller on the server:

> dist:start().

6.  In the client shell, register each with the server, using a nickname for the client:

> dist:register_me(aserver@fullyqualified.com,"BillyBob").

7.  The server process can now use the clients to decrypt passwords:

> dist:decrypt("word").  

As always, the example is contrived.  The "word" is MD5 hashed, then the clients receive some range of
characters to examine to find the match.  The results are reported back to the server.

Total non-sequitur now.  For the BEST VIDEO EVER on Erlang, watch http://www.youtube.com/watch?v=uKfKtXYLG78

2008-09-02:  Code for Intro to Erlang concurrency talk to be given at BarCamp Tampa unconference
(http://barcamptampabay.com/) on Oct. 11, 2008 by Barry Ezell.  I am new to Erlang and this
project is as much a learning experience as a teaching experience.  Erlang programmers
are welcomed to comment on or contribute to this code.  I can be reached at barrye _@t_ gmail.com

The goal of the application is to decrease the time necessary to perform brute-force decryption
of MD5-hashed passwords by using concurrent Erlang processes.  The code is for demonstration
only and is not fit for production and is not intended for malicious use.
Passwords must only be lowercase characters (no numbers) and the decrypt function must 
be told how long the password is.  To encrypt and decrypt the string "hello" in the Erlang shell, 
execute the following:

>c(pwd).
>X = pwd:encrypt("hello").
>pwd:decrypt(X,5,2).

The arguments to decrypt are (encrypted password, password length, number of processes to spawn).
In its current state, the program is concurrent but not distributed so the number of processes
to spawn will depend on the number of CPUs/cores available on the test system.