As the unique nonlinear component of block ciphers, Substitution box (S-box) directly affects the safety of a cryptographic system. It is important and difficult to design strong S-box that simultaneously meets multiple cryptographic criteria such as bijection, nonlinearity, strict avalanche criterion (SAC), bit independence criterion (BIC), differential probability (DP), and linear probability (LP). Though many chaotic S-boxes have been proposed, the cryptographic performance of most of them needs to be further improved. A new chaotic S-box based on the intertwining logistic map and bacterial foraging optimization is designed in this paper. It firstly iterates the intertwining logistic map to construct many S-boxes and then applies a bacterial foraging optimization algorithm to find the optimal S-box. Moreover, bacterial foraging optimization algorithm considers the nonlinearity and differential uniformity as the fitness functions in the optimization process. We experiment that the proposed S-box can effectively resist multiple types of cryptanalysis attacks.