Encryption is the most secure way to save data, whether text, images, video, or any other type of multimedia, as in recent years, a lot of encryption algorithms have been suggested to protect this digital data from all kinds of attacks, and the protection process was carried out through encryption and the use of many algorithms. Through the proposed method, this research was focused on an important aspect, which is protecting the key by creating a new method for the algorithm key, as the more difficult it is to know the key, the more difficult it is to break the algorithm, as Rubik's Cube method was used to create the key of the AES algorithm, where it performs just throw the cube to generate the key, then the improved algorithm was used to encrypt the images and then restore the original image without problems and the process was of a high quality as the key configuration time was reduced and a good level of security was provided. The proposed method has been programmed in Visual Basic.Net 2015 language.