The blood-brain barrier (BBB) is a highly protective structure that strictly regulates the passage of molecules, ensuring the central nervous system remains free from harmful chemicals and maintains brain homeostasis. Since most compounds cannot easily cross the BBB, assessing the blood-brain barrier permeability (BBBP) of drug candidates is critical in drug discovery. While several computational methods have been developed to screen BBBP with promising results, these approaches have limitations that affect their predictive power. In this study, we constructed classification models for screening the BBBP of molecules. Our models were trained with chemical data featurized by a Masked Graph Transformer-based Pretrained (MGTP) encoder. The molecular encoder was designed to generate molecular features for various downstream tasks. The training of the MGTP encoder was guided by masked attention-based learning, improving the model's generalization in encoding molecular structures. The results showed that classification models developed using MGTP features had outperformed those using other representations in 6 out of 8 cases, demonstrating the effectiveness of the proposed encoder. Also, chemical diversity analysis confirmed the encoder's ability to effectively distinguish between different classes of molecules.