public boolean setup() throws FileNotFoundException, NoSuchAlgorithmException {
		if ( pwManSQLite == null ) {
			throw new RuntimeException( "PWManCipher: pwManSQLite not set" );
		}
		if ( password == null ) {
			throw new RuntimeException( "PWManCipher: password not set" );
		}
		if ( algorithm == null ) {
			throw new NoSuchAlgorithmException();
		}
		
		boolean algorithmFound = false;
		for ( PWManAlgorithm pwmanAlgorithm : algorithms ) {
			if ( pwmanAlgorithm.getName().compareTo( algorithm ) == 0 ) {
				algorithmFound = true;
				this.pwmanAlgorithm = pwmanAlgorithm;
			}
		}
		if ( !algorithmFound ) {
			throw new NoSuchAlgorithmException( "Algorithm: " + algorithm + " is not supported or not found" );
		}
		
		keyCrypted = pwManSQLite.getKeyCrypted();
		
		byte[] keyForDatabaseKey = password;
		if ( pwmanAlgorithm.isKeyPadding() ) {
			keyForDatabaseKey = padKey( password, pwmanAlgorithm.getSupportedKeyLengths() );
		}
		
		// Here goes the decryption of database key
		keyDatabaseOriginal = decrypt( keyForDatabaseKey, keyCrypted, false );
		
		if ( !checkKey( keyDatabaseOriginal ) ) {
			defaultKey = null;
			shutdown();
			return false;
		}
		
		byte[] keyBase64 = removeTag( keyDatabaseOriginal );
		defaultKey = Base64.decodeBase64( keyBase64 );
		
		return true;
	}