reset password
Author Message
Vanquish39
Posts: 134
Posted 17:00 Nov 25, 2011 |

Upon "receiving" the message the receiver first reads the BigInteger values (using an ObjectInputStream), then "encrypts" them using the proper key generated in Part 1 of the assignment using the ElGammal algorithm.  The resulting BigInteger is then converted back to an array of bytes using the toByteArray() method, with the result being the digest array that you will now use to check to see if the message has been tampered with. 

 

So the receiver will receive 2 signatures and a message.  Do we encrypt both of these signatures?  and do we make a byte array from both of these encrypted values?

Redalb
Posts: 22
Posted 22:26 Nov 25, 2011 |

I think it is a typo to say encrypts, I think it should say decrypt. All it is saying is get V1 and V2 using the senders public keys. It would seem to me that V1 and V2, if left in big integer form would still be comparable. I dont know why she wants us to convert it to a byte array to compare. To do the math you need to use the biginteger functions, why not just compare the two big integers directly, i dont know.

Last edited by Redalb at 22:35 Nov 25, 2011.
Vanquish39
Posts: 134
Posted 22:46 Nov 25, 2011 |

Yea it is confusing that way.  Btw, I have wrote the algorithm to calculate v1 and v2.  If I use small numbers, it calculates correctly.  When I use her p value, it stalls and doesn't calculate.  I'm using BigInteger.


Any idea.

Redalb
Posts: 22
Posted 23:16 Nov 25, 2011 |

Make sure you're using the functions in the big integer class to do the calculations.

Vanquish39
Posts: 134
Posted 23:17 Nov 25, 2011 |

All the functions are using biginteger.  No idea why it's stalling. 

It is literally doing 2 ^ 158931 or something lol

Redalb
Posts: 22
Posted 23:26 Nov 25, 2011 |

Time to add unique printline statements after everything so you know where it happens.

Vanquish39
Posts: 134
Posted 23:35 Nov 25, 2011 |

did that lol

Vanquish39
Posts: 134
Posted 23:36 Nov 25, 2011 |

when calculating v2

it's like what.. e2 ^  s1 or some shit like that.  It stalls there

if i reduce the p value, it works.

Last edited by Vanquish39 at 23:37 Nov 25, 2011.
Redalb
Posts: 22
Posted 23:43 Nov 25, 2011 |

Try changing the command line options to increase the memory, unlikely but worth a shot.
 

 

-Xms<size>        set initial Java heap size
-Xmx<size>        set maximum Java heap size
-Xss<size>        set java thread stack size
 

For example, you can set minimum heap to 64 MB and maximum heap 256 MB for a Java program HelloWorld.

java -Xms64m -Xmx256m HelloWorld

 
Most IDEs will let you add command line options, so you dont have to run java in cmd
Last edited by Redalb at 00:26 Nov 26, 2011.
Vanquish39
Posts: 134
Posted 02:20 Nov 26, 2011 |

Thank you Redal for your time. 

Instead of using mod use modPow from biginteger.  Else it will stall.