def change_password!(new_master_password)
      self.class.password_policy.validate!(new_master_password)

      @backend.transaction{
        # Decrypt each key and value with the old master password and encrypt them with the new master password
        copy = {}
        @backend[:user].each{|k,v|
          # No need to (de)serialize - the value comes in as JSON and goes out as JSON
          new_key = Encryptor.encrypt(decrypt(k), :key => new_master_password)
          new_val = Encryptor.encrypt(decrypt(v), :key => new_master_password)
          copy[new_key] = new_val
        }

        # re-write user branch with newly encrypted keys and values
        @backend[:user] = copy

        # from now on, use the new master password as long as the object lives
        @master_password = new_master_password

        timestamp!(:last_modified)
        @backend[:system][:salt] = encrypt(Random.rand.to_s)
      }
    end
def change_password!(new_master_password)
      self.class.password_policy.validate!(new_master_password)

      @backend.transaction{
        # Decrypt each key and value with the old master password and encrypt them with the new master password
        copy = {}
        @backend[:user].each{|k,v|
          # No need to (de)serialize - the value comes in as JSON and goes out as JSON
          new_key = Encryptor.encrypt(decrypt(k), :key => new_master_password)
          new_val = Encryptor.encrypt(decrypt(v), :key => new_master_password)
          copy[new_key] = new_val
        }

        # re-write user branch with newly encrypted keys and values
        @backend[:user] = copy

        # from now on, use the new master password as long as the object lives
        @master_password = new_master_password

        timestamp!(:last_modified)
        @backend[:system][:salt] = encrypt(Random.rand.to_s)
      }
    end
Change the master password to +new_master_password+. Note that we don't take a password confirmation here.
 This is up to a UI layer.