0% found this document useful (0 votes)
7 views20 pages

Lab 1 2 Aes Rsa Encryption Vf17

The document discusses encryption techniques, particularly focusing on AES and RSA, which are crucial for database security. It explains the processes of encryption and decryption, the types of encryption (symmetric and asymmetric), and the importance of protecting user data and complying with security regulations. The document concludes that implementing these encryption methods is vital for maintaining data confidentiality and preventing unauthorized access.

Uploaded by

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

Lab 1 2 Aes Rsa Encryption Vf17

The document discusses encryption techniques, particularly focusing on AES and RSA, which are crucial for database security. It explains the processes of encryption and decryption, the types of encryption (symmetric and asymmetric), and the importance of protecting user data and complying with security regulations. The document concludes that implementing these encryption methods is vital for maintaining data confidentiality and preventing unauthorized access.

Uploaded by

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

Database Security &

Encryption
🔐 Implementing encryption
techniques (AES, RSA)

Kamel.Alsulima
n
Dr.Ahmad Al-
Qudah
Project 2025
What is Encryption?

The process of converting information or data into


codes to prevent unauthorized access’
Encryption
• Data/Information – i
• Encrypted data = cipher = C
• Encryption Algorithm = E
• Encryption Key = K
• Decrypted data = plaintext = d

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.

• Encryption Algorithm: Performs


encryption
– Inputs needed: plain text and secret key

• Deciphering or Decryption: Process of


recovering plain text from cipher

• Secret Key: used for encryption or


decryption
Encryption
Substitution technique for other keys
AES Functionality
The plain text Message
Keep Iterating
Substitution technique for other keys
Encryption - Types
• Symmetric Encryption: Process encryption where
same key is used to encrypt and decrypt the
data:
Encryption – Types (2)
• Asymmetric Encryption AKA PKI: Process
encryption where public and private keys are used
to encrypt and decrypt the data:
‫( التشفير المتماثل‬AES)

‫نفس المفتاح للتشفير وا‬

‫مثال‬ :
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)

Plain Text AES Engine Key

Encrypted
ryp Unreadable binary
Data format data

Reversal for
decryption
‫‪ RSA‬و ‪AES‬‬ ‫مقارنة بين‬
AES- Behind the Scene
‫التشفير غير المتماثل‬ )RSA)
‫ماذا نستخدم التشفير في قواعد البيانات؟‬

‫لحماية بيانات المستخدمين‪1-‬‬

‫االمتثال ألنظمة األمان‪2-‬‬


‫مثل( ‪)GDPR‬‬
Hashing ‫التجزئة‬
‫كلمات المرور لحماية‬

‫ لتأمين كلمات الس‬bcrypt ‫ أو‬SHA-256 ‫ستخدام‬

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.

Thank you for listening.

You might also like