Archive

Since it seems like passwords are getting leaked way too often these days, I thought I’d throw a super quick sample out there for anyone with a need to store user passwords in their system. Some important rules:

1. Don’t use reversible encryption, like 3DES or AES.
2. Always use a SALT for each set of credentials, otherwise you’re open to dictionary attacks should your hashes be compromised. You’ll want to store this alongside your hash in whatever password store you’re using.
3. Don’t invent your own algorithms – use a proven one written by experts that write them professionally, like PBKDF2.

And on to the code sample. Six lines of C# that work on Windows and Linux / Mono will get you a solid method for generating secure hashes. Enjoy. I hope this helps people out and gets more developers to use effective password security measures.

RabbitMQ takes a little extra effort to get it working on CentOS 6, particularly if using clustering. After you’ve installed, you need to do the following before trying to set up the cluster.

Edit /etc/hosts to ensure all cluster nodes can resolve the hostnames of each other. These hostnames need to match what is displayed after `rabbit@` in rabbitmqctl status.

Next, you need to take care of the ports needed for distributed Erlang processes to communicate. If you don’t do this, then no matter what you do, when you try to create the cluster it will give you ‘error_no_running_cluster_nodes’.

RabbitMQ runs on Erlang, and tor the nodes to talk, they need a few extra ports open beyond the standard 5672 that AMQP uses. One is for epmd (Erlang Port Mapper Daemon) and that is a standard 4369. Then you have a port range that Erlang nodes to communicate. You need to define this range so you can open these ports on your firewall.

To tell RabbitMQ to instruct Erlang to communicate on a certain range of ports, create a file at /etc/rabbitmq/rabbitmq.config with the following contents:

This will force the nodes in the cluster to only communicate over these ports. Restart RabbitMQ with `service rabbitmq-server restart` so the change takes effect. Now for the iptables configuration. Update /etc/sysconfig/iptables with the following rules: