Advanced Encryption Standard (AES)-128,192, 256

Advance Encryption Standard-128, 192, or 256 encryption and decryption using 128/192/256-bit hexadecimal key and 128-bit hexadecimal input.
Updated 25 Jan 2021

View License

AES-128/192/256 algorithm for creating a cipher given a 128-bit hexadecimal input message and 128/192/256-bit hexadecimal key. Created using FIBS-197 standard. Algorithm was not built for speed and does not covert a text message or data input 128-bit input blocks. Cipher and InvCipher are the main functions to execute. Function executes AES128 or AES192 or AES256 based on the key size. Functions do not check whether the key size or input are the correct length and will error if they are not the correct size.

Out = Cipher(key,In)


Cite As

David Hill (2024). Advanced Encryption Standard (AES)-128,192, 256 (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2020a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Encryption / Cryptography in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Corrected coding for new versions of MATLAB.


Added 128 and 192 bit key choices


Corrected error.


Upgraded and simplified code.