In today's digital era, the importance of securing information has reached critical levels. Steganography is one of the methods used for this purpose by hiding sensitive data within other files. This study introduces an approach utilizing a chaotic dynamic system as a random key generator, governing both the selection of hiding locations within an image and the amount of data concealed in each location. The security of the steganography approach is considerably improved by using this random procedure. A 3D dynamic system with nine parameters influencing its behavior was carefully chosen. For each parameter, suitable interval values were determined to guarantee the system's chaotic behavior. Analysis of chaotic performance is given using the Lyapunov exponents, fractal dimension, and bifurcation diagrams. Furthermore, an algorithm is suggested to generate a random binary key, serving as the controller for the embedding process. And the randomness of the generated key was checked. Moreover, this paper introduces a technique that utilizes the generated random key to govern both the embedding process in the spatial domain and the frequency domain. The results of this study are promising and its potential applications can be extended to various fields that require discreet communication and robust data protection