In present context, researchers have only found that memristor-based time-delay (MBTD) chaotic systems have rich dynamic behavior, but there are still many shortcomings in analyses and applications of MBTD chaotic systems. In this paper, relying on a memristor-based 4D chaotic system, by introducing delay parameters into this system, we not only find that the Lyapunov exponents (LEs) of the system change from one positive to multiple positive, i.e., the system changes from chaotic to hyperchaotic. And the coexistence of the system becomes more obvious. Although the circuit design of the delayed chaotic system is complex, the circuit implementation in Multisim is still given in this work. Ultimately, a novel digital image encryption algorithm based on this system is explained in details by introducing a hash algorithm. The proposed encryption algorithm, with strong robustness to external interference, good key sensitivity and good plaintext sensitivity, can handle images of different shapes, can effectively implement plaintext image encryption, and can resist differential attacks. All of the above further illustrate the advantages of the encryption algorithm and good randomness of the 4D MBTD hyperchaotic system.