This paper investigates the problem of bipartite leader-following consensus for a class of multiagent systems with time-varying delays and switching signed networks under deception attacks, which includes bipartite tracking consensus for a single leader and bipartite containment control for multiple leaders. The states transmitted in the signed network are assumed to randomly suffered deception attacks at each impulse instant. By utilizing the gauge transformation, Markovian switching Lyapunov function and Halanay differential inequality techniques, some sufficient conditions are obtained to achieve bipartite leaderfollowing consensus, which are not only applicable to bipartite tracking consensus but also to bipartite containment control. In addition, the bipartite leader-following consensus problems under special cases such as fixed signed network, no deception attacks and no time-varying delays are also addressed. Two numerical examples are provided to show the effectiveness of the proposed results. Finally, the proposed bipartite consensus theory is applied to construct a new multiagent image secure communication system, where the leading agents and following agents for image communication can generate consistent encryption/decryption keystreams. The experimental results indicate that the constructed multiagent image secure communication system has excellent performance in statistical properties, correlation, key sensitivity, differential attacks and information entropy analysis.