public boolean isAuthorized(String password) {
        if (encryptionDictionary.getRevisionNumber() < 5){
            boolean value = standardEncryption.authenticateUserPassword(password);
            // check password against user password
            if (!value) {
                // check password against owner password
                value = standardEncryption.authenticateOwnerPassword(password);
                // Get user, password, as it is used for generating encryption keys
                if (value) {
                    this.password = standardEncryption.getUserPassword();
                }
            } else {
                // assign password for future use
                this.password = password;
            }
            return value;
        }else if (encryptionDictionary.getRevisionNumber() == 5){
            // try and calculate the document key.
            byte[] encryptionKey = standardEncryption.encryptionKeyAlgorithm(
                                        password,
                                        encryptionDictionary.getKeyLength());
            this.password = password;
            return encryptionKey != null;
        }else{
            return false;
        }
    }