A new 4D chaotic system with self-excited attractors or hidden attractors is designed and the generation of self-excited attractors and hidden attractors depends on the parameters of the new 4D chaotic system. The detailed dynamical properties of the designed new 4D chaotic system have been vividly demonstrated in terms of phase portraits, bifurcation diagrams, and Lyapunov exponents. When fixing the system parameters and changing the initial value, different kinds of coexisting asymmetric attractors are discovered in the new 4D chaotic system. Besides, the corresponding analog electronic circuit of the 4D chaotic system is designed and implemented to verify its feasibility, concurrently the random number generator and an image encryption algorithm based on the designed new 4D chaotic system are provided. Then the effectiveness of the image encryption system is verified by some basic security analysis.