diff --git a/modules/authcrypt/lib/Auth/Source/Htpasswd.php b/modules/authcrypt/lib/Auth/Source/Htpasswd.php
index 9d416bd05375f72d335c24c7a685bf8fa6f4c8df..99923e18f96179efc931f76023f256e3e0edbde1 100644
--- a/modules/authcrypt/lib/Auth/Source/Htpasswd.php
+++ b/modules/authcrypt/lib/Auth/Source/Htpasswd.php
@@ -80,7 +80,7 @@ class sspmod_authcrypt_Auth_Source_Htpasswd extends sspmod_core_Auth_UserPassBas
 				}
 
 				// Apache's custom MD5
-				if(APR1_MD5::check($crypted, $password)) {
+				if(APR1_MD5::check($password, $crypted)) {
 					SimpleSAML\Logger::debug('User '. $username . ' authenticated successfully');
 					return $attributes;
 				}