The crypt gem with 1.9 compatibility and some refactoring.