diff --git a/src/Authentication/Factories/PasswordFactoryLDAP.php b/src/Authentication/Factories/PasswordFactoryLDAP.php
index <HASH>..<HASH> 100644
--- a/src/Authentication/Factories/PasswordFactoryLDAP.php
+++ b/src/Authentication/Factories/PasswordFactoryLDAP.php
@@ -11,7 +11,7 @@ class PasswordFactoryLDAP
 	/**
 	 * Generates and returns a new password as a SSHA hash for use in LDAP. If
 	 * the salt is not specified, one will be generated using the openssl
-	 * extension with a length of four bytes.
+	 * extension and have a length of four bytes.
 	 *
 	 * @param string $password The plaintext password to hash
 	 * @param string $salt Optional salt for the algorithm
@@ -20,8 +20,16 @@ class PasswordFactoryLDAP
 	 */
 	public static function SSHA($password, $salt=null) {
 		if(empty($salt)) {
-			// salts should be four bytes
-			$salt = openssl_random_pseudo_bytes(4);
+			if(function_exists('openssl_random_pseudo_bytes')) {
+				// salts should be four bytes
+				$salt = openssl_random_pseudo_bytes(4);
+			}
+			else
+			{
+				throw new Exception(
+					"You must have the openssl extension installed and loaded to use a random salt"
+				);
+			}
 		}
 		return "{SSHA}" . base64_encode(sha1($password . $salt, true) . $salt);
 	}
Bolstered the method to generate a SSHA password