listofer murphy - 2010-04-01 02:18:09
Hi,
I have to develop one algorithm for Uni assignment but I have few doubts. I am attaching requirement spec below.
Randomised key substitution key can be implemented using Diffie Hellman algorithm but to implement Diffie Hellman we need to exchange keys between pages. Problem is one page is in HTML and other page is in PHP.
To understand in better way. Please have a look at below image.
Diffie Hellman algorithm's key exchange.
I can pass my p,g and A variable's value to PHP file. PHP file can read these variables using $_POST or $_GET and generate KEY on Server where PHP code is running. But now its PHP files turn to return B variable to HTML file so that HTML file will use this B to create KEY and then secure data transfer will be done using this KEY.
Can someone tell me how can PHP send value to HTML file that can be read by HTML file to create KEY.
Randomised Substitution Keys
use a randomised key which must be based on a random value, whether it be
a seed, time, part of the IP.
Thus the cipher is never the same twice.
You will be essentially be cloning Part 1 in order to do this, code re-use is allowed, however you will come
across two problems
1. key agreement between client and server. You must create a protocol to deal with this.
2. whether or not your PHP and Javascript algorithms will output the same thing (hint: look at rand()).
For this part, you must create 5 files:
SendCode.html -> RecvCode.php and ReqData.html -> SendData.php -> DispData.html
where the PHP files are on the server and HTML on the client and:
· the first case is a HTML form which data is encrypted first, then sent to the server which then decrypts it
· the second case is a HTML request form where the response is encrypted and decrypted by the client.
This means that you need to write encryption and decryption code in both PHP and Javascript.