In this paper, we propose an algorithm for constructing a nonlinear component of block cipher by using the non-associative class of Moufang Loops (ML) and with the help of this nonlinear component design a cryptosystem for image encryption. The ML includes excellent features such as the inverse of zero elements, weak associativity, and fewer constraints in comparison with cyclic groups and Galois fields. The construction of a nonlinear component (substitution box, briefly, S-box) consists of bijective loop operations and permutations. There are two permutations, first by using a bijective map and second by using ML. This proposed S-box is used in an image encryption scheme. The encryption scheme consists of five steps. Firstly, the plain image is converted into the matrix and multiplies this matrix with an upper triangular matrix of ones. Then, substitute this output matrix with the values of the S-box and shuffle the pixels by using a logistic map. After this, multiply this output matrix with a self-invertible matrix. The evaluation of the proposed S-box with different algebraic and statistical analyses like nonlinearity test, strict avalanche criterion, bit independence criterion, linear approximation probability, and differential approximation probability indicates the strength of the proposed S-box. The presented procedure of image encryption also delivers excellent security in response to known cryptographic assaults as founded by the many statistical analysis and security assessments.