Galois Counter Mode (GCM) Block Cipher using AES

버전 1.0.0 (6.04 KB) 작성자: David Hill
Encrypt/Decrypt a plaintext message using AES GCM.
다운로드 수: 118
업데이트 날짜: 2021/12/2

라이선스 보기

Galois Counter Mode (GCM) Block Cipher using AES-128,192,256 based on the key length. Implimentation is based on NIST Special Publication 800-38D.
Inputs: secretKey - AES secret key, hexidecimal (128,192, or 256 bits), iv - initialization vector (random 96-bit hexidecimal), plainTextInput - plaintext message of input that needs to be encrypted, aad - additional authenticated data (plaintext string).
Outputs: outputCipher - hexidecimal encrypted Cipher, authTag - authentication tag (hexidecimal).
The initialization vection is not generated by the code and must be provided. It is extremely important that the initialization vection be different for each encryption using the same secret key (see NIST publication for explanation).
Example:
key='44a74c1a57da2bf6d6838956cdca13f1b67cc6ad87d459bff544784083868171';
iv='4392367e62ef9aa706e3e801';
plainTextInput='I like to swim!';
aad= 'additional unencrypted instructions';
[C,T]=GCM_AE(key,iv,plainTextInput,aad)
C =
'6deb6e66165c0f8d85369aa4da0c1d'
T =
'1ec4fb95081845d94bca1c4d'
[P,A]=GCM_AD(key,iv,C,aad,T)
P =
'I like to swim!'
A =
logical
1

인용 양식

David Hill (2024). Galois Counter Mode (GCM) Block Cipher using AES (https://www.mathworks.com/matlabcentral/fileexchange/102850-galois-counter-mode-gcm-block-cipher-using-aes), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2021a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0