Preparation method of protein and peptide nanoparticles for in vivo delivery of pharmacologically active agetnts is disclosed. The method is carried out to encase pharmaceutically active agents into proteins or peptides to form nanoparicles by unfolding and refolding transitions, wherein said unfolding and refolding transitions comprise subjecting proteins or peptides to unfolding solution or external stress and then refolding them in refolding solution. The produced particles comprise 1-25% by weight of pharmacologically active agents.