This paper introduces a pioneering, effective data-hiding algorithm using different sizes of cover images and different types of secret data (image, txt, and audio). The proposed algorithm is based on a hybrid 1D chaotic map combined with a 2D composite chaotic map paired with optimization and Least Significant Bits (LSB) techniques. We employ chaotic maps to create the initial embedding position vector, and LSB to hide the secret message in the cover image. The optimization technique utilizes the chaotic maps to optimize the random embedding sites, looking for value matches between the cover image pixels and the secret data bits. This partial improvement leads to a high-quality stego-image, a large embedding capacity, imperceptibility to the human eye, undetectability, and enhanced security. The outcomes of the extensive experiments show that when the payload is 4.2 bits per pixel, the peak signal-to-noise ratio value (PSNR), which expresses the visual quality, is above 30 dB. Furthermore, the experimental results illustrate that the system exhibits robustness against various types of attacks. As a final point of strength, the large key space (2^206) prevents the secret data from being resolved if stego-images are accessed by intruders or third parties. Even minor changes in key bits can significantly alter the extracted secret data, resulting in entirely different secret data.