You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Input a hexadecimal 256-bit AES key (AESkey), an image file name that needs to be either encoded or decoded, and the filename where you want the encoded/decoded image saved. This uses JAVA libraries to perform the image encryption/decryption but you can use my AES MATLAB code to perform the same operations natively. The randomly assigned initiation vector during encoding is converted to hexadecimal and stored as a comment when saving the .png encrypted image file. Recommend always using the .png file or another image file that does not compress and still has the ability to save a comment.
%encodes image
encodedImage3Dmatrix = AESimageEncryption(originalImageFilename,AESkey, encodedImageOutputFilename);
imshow(encodedImage3Dmatrix);
%decodes image
decodedImage3Dmatrix = decodeAESimage(encryptedImageFilename,AESkey,decodedImageOutputFilename);
imshow(decodedImage3Dmatrix);
Cite As
David Hill (2026). AES-256 CTR mode Image Encryption/Decryption (https://ch.mathworks.com/matlabcentral/fileexchange/183738-aes-256-ctr-mode-image-encryption-decryption), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.2 (2.41 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
