Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

SPRING 2024

APT3090 CRYPTOGRAPHY AND NETWORK SECURITY

IMPLEMENTATION OF RSA OVER TCP 15 Marks

Group Project:

Read about implementation of TCP Client and Server Sockets - Java/Python

Purpose:

1) Write a program to implement RSA algorithm with key size 1024 bits.
2) After public key and private key been generated, use Alice/Bob application over TCP to demonstrate
encryption and decryption process. Sockets provide the communication mechanism between two
computers using TCP. TCP is a two-way communication protocol.

Methods:

The program consists of two classes one is Alice which present the one who generate the public key pair
and send the public key to Bob through TCP socket, then decrypt the ciphertext received from Bob.
The other one is Bob who will use the public key to encrypt the message and send the ciphertext to Alice
for decryption. . The input p and q should be generated by random numbers program

To encrypt a message, M, with the public key, create the ciphertext, C, using the equation: C =

e
M mod n

The receiver then decrypts the ciphertext with the private key using the equation: M

d
= C mod n

In Alice:

1) Generate a BigInteger p which has bit length 512, prime certainty 1-1/2^50. The p is generated using
SecureRandom object Generate q the way as p.
2) Calculate p * q = n and ( p-1)*(q-1)
3) After public key n and private key d have been generated, if user click “send” the program will create
a TCP socket with hostname and port number and send the public key to Bob.
4) Create ServerSocket to wait for client and create a Socket for the connection to receive the ciphertext
from Bob.
5) Read ciphertext c from TCP socket and calculate plaintext m using d

In Bob:

1) Create ServerSocket to wait for client and create a Socket for the connection to receive the public key
from Alice.
2) After the user key in the plaintext and click “send”, calculate the ciphertext using public key
n , e and modPow function of BigInteger. Create

Prepare a lab report for the above assignment. The lab report should capture the source code and
sample output.

Project demonstration Week 13


SPRING 2024

APT3090 CRYPTOGRAPHY AND NETWORK SECURITY

CREDIT CARD VAULT GROUP PROJECT 20 Marks

Group Project

Phase 1
a) Credit Card Vault Project: A merchant need to store customer’s credit card details.
You only need to collect credit card information from a customer once, then store the
card details in the vault. The next time you want to invoice a customer, you can use
the stored card information.
b) Identify sensitive, confidential and public information
c) Identify users access levels (Who should Select,Insert,Delete,Update)
d) Provide a schema showing relationship of tables in 3NF.

Phase 2

a) Create your database as per your 3NF


b) Write scripts to insert and retrieve (sensitive, confidential and public information)
using AES_ENCRYPT and AES_DECRYPT FUNCTIONS.
c) The application can be entered using a username and password for different type of
users. The password should be hashed using SHA-2.
d) Create atleast three views
e) The application should allow different types of authenticated users to access the data
base based on their level of privileges.
f) Host your application and install SSL Certifcate
e) Prepare a final project report. The lab report should capture the source code important
function , sample input forms and backend structure of your DB.

Project demonstration Week 13

You might also like