7._ISDV_Exp[1]
7._ISDV_Exp[1]
Experiment No: 7
Implementation of AES
Date:
Relevant CO: Implement and analyze various symmetric key cryptography algorithms
and their application in different context
Algorithm:
Program:
# Import necessary libraries
from Crypto.Cipher import AES
import base64
# AES Implementation
def aes_encrypt(plaintext, key):
# Create an AES cipher object
cipher = AES.new(key, AES.MODE_ECB)
# Encrypt the plaintext
ciphertext = cipher.encrypt(plaintext)
return ciphertext
# Main program
if __name__ == "__main__":
# Define the plaintext and key
plaintext = b"Hello, World!"
key = b"1234567890123456" # 16-byte key for AES
Output:
AES Encryption:
Ciphertext: b'\x8d\x95\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa'
Decrypted: b'Hello, World!'
Conclusion:
- In this program, we implemented and analyzed the AES symmetric key cryptography
algorithm. We demonstrated the encryption and decryption processes for AES using the Python
programming language and the PyCrypto library.
- Our analysis showed that AES is a widely used and secure algorithm, suitable for various
3170720 INFORMATION SECURITY 210210107007
Quiz:
Suggested Reference:
1. https://www.geeksforgeeks.org/advanced-encryption-standard-aes/
Rubrics 1 2 3 4 5 Total
Marks