diff --git a/protected_node.fork.inc b/protected_node.fork.inc
index d40613e..7c6dcbd 100644
--- a/protected_node.fork.inc
+++ b/protected_node.fork.inc
@@ -212,11 +212,12 @@ function protected_node_enter_any_password_validate($form, &$form_state) {
   // @todo We do not want to check the global password if there is a local
   // password (i.e. extract local password instead of comparing!).
   $nids = protected_node_password_nids();
-  $passwd = sha1($form['#post']['password']);
+  $sha1_passwd = sha1($form['#post']['password']);
+  $sha256_passwd = hash('sha256', $form['#post']['password']);
 
   $nid = db_query_range('protected_nodes', '')
     ->fields(array('nid'))
-    ->condition('protected_node_passwd', $passwd)
+    ->condition('protected_node_passwd', array($sha1_passwd, $sha256_passwd), 'IN')
     ->condition('nid', $nids, 'IN')
     ->execute()
     ->fetchField();
diff --git a/protected_node.module b/protected_node.module
index 5db5863..49076ed 100644
--- a/protected_node.module
+++ b/protected_node.module
@@ -792,7 +792,7 @@ function _protected_node_save(&$node) {
         }
         else {
           $node->protected_node_clear_passwd = $node->protected_node_passwd;
-          $node->protected_node_passwd = sha1($node->protected_node_passwd);
+          $node->protected_node_passwd = hash('sha256', $node->protected_node_passwd);
         }
       }
     }
@@ -837,7 +837,7 @@ function _protected_node_save(&$node) {
     }
     elseif ($node->protected_node_passwd) {
       $node->protected_node_clear_passwd = $node->protected_node_passwd;
-      $node->protected_node_passwd = sha1($node->protected_node_passwd);
+      $node->protected_node_passwd = hash('sha256', $node->protected_node_passwd);
     }
     // We don't need to set the protected_node_passwd_changed since no
     // one has ever entered a password for this node.
@@ -1097,7 +1097,7 @@ function protected_node_set_protected($param, $passwd = NULL) {
         $result = db_update('protected_nodes')
           ->fields(array(
             'protected_node_is_protected' => 1,
-            'protected_node_passwd' => sha1($passwd),
+            'protected_node_passwd' => hash('sha256', $passwd),
             'protected_node_passwd_changed' => REQUEST_TIME
           ))
           ->condition('nid', $node->nid)
@@ -1110,7 +1110,7 @@ function protected_node_set_protected($param, $passwd = NULL) {
         $passwd = '';
       }
       else {
-        $passwd = sha1($passwd);
+        $passwd = hash('sha256', $passwd);
       }
       $result = db_insert('protected_nodes')
         ->fields(array(
@@ -1131,7 +1131,7 @@ function protected_node_set_protected($param, $passwd = NULL) {
 
     $result = db_update('protected_nodes')
       ->fields(array(
-          'protected_node_passwd' => sha1($passwd),
+          'protected_node_passwd' => hash('sha256', $passwd),
           'protected_node_passwd_changed' => REQUEST_TIME,
         ))
       ->condition('nid', $node->nid)
diff --git a/protected_node.redirect.inc b/protected_node.redirect.inc
index 05ae30b..e9a976e 100644
--- a/protected_node.redirect.inc
+++ b/protected_node.redirect.inc
@@ -150,11 +150,12 @@ function protected_node_enterpassword_validate($form, &$form_state) {
   // password (i.e. extract local password instead of comparing).
   // @todo The protected_node_nid parameter should be extracted from the
   // destination URI.
-  $passwd = sha1($form_state['values']['password']);
+  $sha1_passwd = sha1($form_state['values']['password']);
+  $sha256_passwd = hash('sha256', $form_state['values']['password']);
   $protected_node_nid = $form_state['values']['protected_node_nid'];
   $nid = db_select('protected_nodes')
     ->fields('protected_nodes', array('nid'))
-    ->condition('protected_node_passwd', $passwd)
+    ->condition('protected_node_passwd', array($sha1_passwd, $sha256_passwd), 'IN')
     ->condition('nid', $protected_node_nid)
     ->execute()
     ->fetchField();
diff --git a/protected_node.settings.inc b/protected_node.settings.inc
index c4ca975..a4f6f13 100644
--- a/protected_node.settings.inc
+++ b/protected_node.settings.inc
@@ -721,7 +721,7 @@ function _protected_node_admin_settings_validate($form, &$form_state) {
 function _protected_node_admin_settings_submit($form, &$form_state) {
   $passwd = $form_state['values']['protected_node_global_password_field'];
   if ($passwd) {
-    variable_set('protected_node_global_password', sha1($passwd));
+    variable_set('protected_node_global_password', hash('sha256', $passwd));
     unset($form_state['values']['protected_node_global_password_field']);
     variable_del('protected_node_global_password_field');
   }
@@ -750,7 +750,7 @@ function protected_node_action_reset_passwords($form, &$form_state) {
   if ($passwd) {
     db_update('protected_nodes')
       ->fields(array(
-        'protected_node_passwd' => sha1($passwd),
+        'protected_node_passwd' => hash('sha256', $passwd),
       ))
       ->execute();
     variable_set('protected_node_session_timelimit', REQUEST_TIME);
@@ -918,7 +918,7 @@ function protected_node_node_type_form_alter(&$form) {
  */
 function _protected_node_node_type_validate($form, &$form_state) {
   if (!empty($form_state['values']['protected_node_node_type_password_field'])) {
-    $form_state['values']['protected_node_node_type_password'] = sha1($form_state['values']['protected_node_node_type_password_field']);
+    $form_state['values']['protected_node_node_type_password'] = hash('sha256', $form_state['values']['protected_node_node_type_password_field']);
   }
   else {
     $node_type = trim($form_state['values']['type']);
diff --git a/tests/protected_node.global.test b/tests/protected_node.global.test
index b4d5881..6c3bf10 100644
--- a/tests/protected_node.global.test
+++ b/tests/protected_node.global.test
@@ -43,7 +43,7 @@ class ProtectedNodeGlobalPassword extends ProtectedNodeBaseTestCase {
    * Test that the password is well hashed when stored.
    */
   public function testHash() {
-    $hashed_global_password = sha1($this->global_password);
+    $hashed_global_password = hash('sha256', $this->global_password);
     $stored_global_password = variable_get('protected_node_global_password');
 
     $this->assertEqual($stored_global_password, $hashed_global_password, "The global password is stored hashed and the value correspond to the global password.", $this->group);
diff --git a/tests/protected_node.per_node.test b/tests/protected_node.per_node.test
index 1731cd8..df40bd7 100644
--- a/tests/protected_node.per_node.test
+++ b/tests/protected_node.per_node.test
@@ -51,7 +51,7 @@ class ProtectedNodePerNodePassword extends ProtectedNodeBaseTestCase {
         ->condition('nid', $node->nid)
         ->execute()
         ->fetchField();
-    $hashed_node_password = sha1($password);
+    $hashed_node_password = hash('sha256', $password);
 
     $this->assertEqual($stored_node_password, $hashed_node_password, "The node's password is stored hashed and the value correspond to the password.", $this->group);
   }
diff --git a/tests/protected_node.per_type.test b/tests/protected_node.per_type.test
index e623992..5d220ba 100644
--- a/tests/protected_node.per_type.test
+++ b/tests/protected_node.per_type.test
@@ -55,7 +55,7 @@ class ProtectedNodePerTypePassword extends ProtectedNodeBaseTestCase {
    * Test that the password is well hashed when stored.
    */
   public function testHash() {
-    $hashed_page_content_type_password = sha1($this->page_content_type_password);
+    $hashed_page_content_type_password = hash('sha256', $this->page_content_type_password);
     $stored_page_content_type_password = variable_get('protected_node_node_type_password_page');
 
     $this->assertEqual($stored_page_content_type_password, $hashed_page_content_type_password, "The page content type's password is stored hashed and the value correspond to the password.", $this->group);
