A pharmaceutical being used for treating HIV infection is provided which has the following peptide sequence: X-SWETWEREIENYTKQIYKILEESQQDRN-EKDRNEKDLLE-Z, where S is Serine, W is Trytophan, E is Glutamate, T is Threonine, R is Argine, I is Isoleucine, N is Asparagine, Y is Tyrosine, K is Lysine, Q is Glutamine, L is Leucine, D is Aspartic acid, X is amino group, acetyl-hydrophobic group, or macromolecule carrier group, Z is carboxyl group, amino group, amido group, tert-nutyloxycarbonyl group, hydrophobic group, or macromolecule carrier group. The drug inhibits strongly the infection of HIV.