Due to the widespread adoption of medical image classification based on machine learning techniques in research in the medical field, safeguarding data privacy has emerged as a significant concern. In order to protect the privacy of medical image data and ensure the accuracy of classification methods, our approach integrates federated learning with blockchain technology. Federated learning facilitates model training without exposing the raw data, while blockchain technology guarantees data integrity and security. Simultaneously, we incorporate homomorphic encryption into the training process of the model for enhanced privacy protection in federated learning. Furthermore, we propose a blockchain partition storage strategy to lower storage consumption in the blockchain network. Experimental results demonstrate that this method not only effectively ensures the privacy of medical image data without substantially compromising model accuracy, but also enhances model robustness.