The document proposes a new algorithm for hiding text within a gray image using least significant bit (LSB) replacement with increased security. The algorithm generates a random key between 1-256 to encrypt the text before embedding it in the image. It uses XOR and AND logic operations to modify the LSB of pixel values and embed the encrypted text. Experimental results show the embedded text can be concealed within the image while maintaining high image quality with PSNR values over 75dB. The algorithm aims to improve upon basic LSB techniques by adding an encryption step using a random key to enhance security of the hidden text.