Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not sure whether this thread works or not

 
Sara Brown
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




i believe my threads are not working well. is there any way to make it work, please. i have been try so many ways but it still end up the same thing. please i dont know what else to do.
 
Sara Brown
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have made the thread at the cipher. but still the performance does not effect much. is there any tips or helps or guide for me making the threads work well?

Thank you for your help.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, please adhere to Java conventions for Class naming.

Other than that, I am not going to wade through and debug your code.

Please let us know how far it gets successfully, and then the failure condition(s).

debug, logging, and at a last resort; System.out.println() are your friends.

WP
 
Sara Brown
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the result for the encryption and decryption whether by using ECB and CBC mode are the same. means that bob and alice retrieve the same secret message.

however, when it comes to the performance, using only 1 thread gives much faster than large number.

I have been reading that we could make it parallel at the cipher but when i look back at my code, i think my algorithm is the same way of sequential one thus it does not make it faster but slowest.

I dont know what else to put to make my thread works. i have been working on plenty of design but it still works the same way. above code is my last code i have been modified.

i have no idea to make it parallel. please, i really need help design this algorithm.

is there any potential place to put the thread other than at the cipher?
 
Sara Brown
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what i do. after we know that alice and bob shared the same secret message, i pass it to a new thread as below.



then it will run back at the run method which is the overide. what i do in the run method is this.



which it will pass to a new method called goKey. and in the goKey() i put it this way.



the goKey() will identify whether it will generate the key or do the encrypt. if the count is 1 then it will pass to new method. and that method will do the cipher.



this cipher will do in two different modes which are in ECB and CBC.



this to make it more clear about what i do in the above code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic