Lab 1 2 Aes Rsa Encryption Vf17
Lab 1 2 Aes Rsa Encryption Vf17
Encryption
🔐 Implementing encryption
techniques (AES, RSA)
Kamel.Alsulima
n
Dr.Ahmad Al-
Qudah
Project 2025
What is Encryption?
i=E(K,C) OR C= EK(i)
d=E(K,C) OR d=EK(C)
Encryption - Terminology
• Encryption or Enciphering: Process of
converting plain text to cipher text.
مثال :
plaintext
Plaintext → Encrypted with AES Key →
Ciphertext
•
مثال عملي على: AES
from Crypto.Cipher import AES
cipher = AES.new(b'Sixteen byte key',
AES.MODE_ECB)
msg = b'Hello World 1234'
encrypted = cipher. encrypt(msg)
HOW AES Works?
• Requirements:
– Software that implements the AES Algorithm
– Inputs: Data (credit card number, plain text) and
Key (encryption key)
Encrypted
ryp Unreadable binary
Data format data
Reversal for
decryption
RSAو AES مقارنة بين
AES- Behind the Scene
التشفير غير المتماثل )RSA)
ماذا نستخدم التشفير في قواعد البيانات؟
import hashlib
print(hashlib.sha256(b'password123').hexd
igest())
RSA Algorithm (value 3)
• Calculate D (Private Key)
– Formula D = 1 + K * X(N) / E
– K will be a random value starting from 0,1,2…
– Value of K should be less than the value of E=7
– The value of k will be changed until the value of
equation is an integer and not a fraction
– Assume K =1
• 1+1*8/7 = 1+8/7= 9/7 = 1.24
• 1+2*8/7 = 1+16/7= 17/7 = 2.42
• 1+6*8/7 = 1+48/7= 49/7 = 7
– Therefore the value of D = 7
RSA –Encryption
• Encryption:
– Cipher = C , Message = M = 2
– C = ((M)^E)mod pq
– C = ((2)^7) mod 15
– C= (128) mod 15
– C=128 mod 77 = 8
RSA –Decryption
• Message M = (C^D) mod PQ
• M = (8^7) mod 15
• M = 2097152 mod 15
• M=2
REPORT WORK
• In conclusion, it is evident that databases
form the backbone of any modern
information system, and protecting such
data using encryption techniques like AES
and RSA is of great importance. These
methods enhance security, maintain
confidentiality, and prevent unauthorized
access.