0% found this document useful (0 votes)
9 views3 pages

7._ISDV_Exp[1]

experiment 7._ISDV_Exp[1]

Uploaded by

Parmar Hiren
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

7._ISDV_Exp[1]

experiment 7._ISDV_Exp[1]

Uploaded by

Parmar Hiren
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

3170720 INFORMATION SECURITY 210210107007

Experiment No: 7
Implementation of AES
Date:
Relevant CO: Implement and analyze various symmetric key cryptography algorithms
and their application in different context

Objectives: (a) to understand working fundamental of AES Algorithm


(b) to carry out Implementation of AES encryption-decryption.

Equipment/Instruments: Computer System, Turbo-c/ JDK


Theory:
AES is a symmetric encryption system that uses 128 bit blocks, The key length is
128/192/256. The algorithm involves carrying out combinations, substitutions and
permutations between the text to be encrypted and the key, while making sure the operations
can be performed in both directions.
The main parts of the algorithm are as follows:
 AES is a block cipher.
 The key size can be 128/192/256 bits.
 Encrypts data in blocks of 128 bits each
.
Example:
3170720 INFORMATION SECURITY 210210107007

Algorithm:

STEP-1:Derive the set of round keys from the cipher key.


STEP-2:Initialize the state array with the block data (plaintext).
STEP-3:Add the initial round key to the starting state array.
STEP-4:Perform nine rounds of state manipulation.
STEP-5:Perform the tenth and final round of state manipulation.
STEP-6:Copy the final state array out as the encrypted data (ciphertext).

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

def aes_decrypt(ciphertext, key):


# Create an AES cipher object
cipher = AES.new(key, AES.MODE_ECB)
# Decrypt the ciphertext
plaintext = cipher.decrypt(ciphertext)
return plaintext

# Main program
if __name__ == "__main__":
# Define the plaintext and key
plaintext = b"Hello, World!"
key = b"1234567890123456" # 16-byte key for AES

# AES encryption and decryption


aes_ciphertext = aes_encrypt(plaintext, key)
aes_decrypted = aes_decrypt(aes_ciphertext, key)
print("AES Encryption:")
print("Ciphertext:", aes_ciphertext)
print("Decrypted:", aes_decrypted)

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

applications, including data encryption and secure communication protocols.


- In conclusion, the AES algorithm is a reliable and efficient choice for symmetric key
cryptography, providing strong security and integrity for data in different contexts.

Quiz:

1. How many rounds does the AES-192 perform?


- AES-192 performs 12 rounds.

Suggested Reference:
1. https://www.geeksforgeeks.org/advanced-encryption-standard-aes/

References used by the students:


https://www.geeksforgeeks.org/advanced-encryption-standard-aes/

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

You might also like