==============================
ASSIGNMENT 1. PART 2. RESULTS
==============================

=======================================================================
PART 2.1 MESSAGE DIGEST GENERATION WITH SHA-1 AND MD5 ALGO
=======================================================================

-------------------------------
TIME AS A FUNCTION OF ALGORITHM
--------------------------------

MESSAGE = [Kanwal Rekhi School of Information Technology, IIT Bombay]

						AVG.(over 6 observations) TIME (in ms)

Message Digest Generation using SHA-1				33.6667

Message Digest Generation using MD5				34.8833


----------------------------------
TIME AS A FUNCTION OF MESSAG SIZE
----------------------------------


					 AVG.(over 6 observations) TIME (in ms)

MESSAGE SIZE				USING SHA-1			USING MD5


0 BYTE(tmp)				33.5000				33.8333	

538 BYTES(tmp1)				34.6667				34.3333		

1062 BYTES(tmp2)			38.8333				34.0000	

2087 BYTES(tmp3)			38.6667				52.3333

4065 BYTES(tmp4)			39.5000				52.0000


ANALYSIS
---------

1. Both the algorithms seem to perform more or less the same for small message sizes.
	-- probably because, they both follow same basic modulo 32 operation and same no of rounds(4).
	   Although SHA-1's output is 160-bit(MD5 -128 bits) and the no of steps in each round 
	   is 20 (MD5 - 16), its not significantly affected by this.

2. The time taken is almost independent of messgage size.
	-- probably because,hash is of fixed length and independent of the size of the message.



=======================================================================
PART 2.2 SIGNATURE GENERATION AND VERIFICATION USING DSA & RSA ALGO
=======================================================================


---------------------------------
TIME AS A FUNCTION OF ALGORITHM
---------------------------------

MESSAGE = [ Kanwal Rekhi School of Information Technology, IIT Bombay ]

							AVG.(over 4 observations) TIME (in ms)

Digital Signature Generation using DSA					20.50

Dital Signature Generation using RSA					82.75


Digital Signature Verification using DSA				45.50

Digital Signature Verification using RSA				 9.00




-----------------------------------
TIME AS A FUNCTION OF MESSAGE SIZE
-----------------------------------

		
							  AVG.(over 4 observations) TIME(in ms)
						
							SIGNING				VERIFICATION

MESSAGE SIZE					USING DSA	USING RSA	USNING DSA	USING RSA


0 BYTE(tmp)					 20.25  	84.25		44.5		 8.25

538 BYTES(tmp1)					 20.75		 76.00		45.25		 9.25

1062 BYTES(tmp2)				 20.50		 73.75		44.75		28.50

2087 BYTES(tmp3)				 21.00		 99.75		45.00		 9.00

4065 BYTES (tmp4)				 21.00		100.75		45.75		 9.00


-------------------------------
TIME AS A FUNCTION OF KEY SIZE
-------------------------------


                                                                TIME (in ms)
                                                SIGNING                                 VERIFICATION
KEY SIZE                                USING DSA       USING RSA               USING DSA       USING RSA

512 bits                                8               43                      12              3

768 bits                                13              78                      22              5

1024 bits                               32              95                       47              8




ANALYSIS
---------
1. RSA takes more time to generate signature than DSA.
	-- probably because, the RSA encryption(esp key generation)is computationally costlier than DSA  

2. Time for Signing is independent of message size in case of DSA. 
	-- because, signatures are computed on digests and the digests are of fixed size 
	   hence irrespective of the message size the time taken for Signing is same.

3. time for Signing is almost independent of message size for RSA.
	-- because, signatures are computed on digests and the digests are of fixed size 
	   hence irrespective of the message size the time taken for Signing is same.


4. DSA takes more time for verification than RSA.
	-- probably because, the DSA decryption is computationally costlier than that of RSA

5. Time for Verification is independent of message size for DSA.
	-- because, verification is done using decryption on fixed size msg digest

6. time for Verification is independent of message size for RSA also.
	-- because, verification is done using decryption on fixed size msg digest

7. As the key size increses, the time for generating signatures increses - for both DSA & RSA
	-- because, the size of the private key(used for encryption) increases.

8. The time for verificartion also increases as the key size increases - for both DSA & RSA
	-- because, the size of the public key(used for decryption) increases.


