Synthesis of protein nanoparticles for drug delivery