?
Solved

How to send serialized tcp packets in Java

Posted on 2009-02-17
10
Medium Priority
?
681 Views
Last Modified: 2013-11-23
I'm trying to use object serialization to send objects via TCP from a client to a server. How is this done? Can I just wrap the output and input streams with ObjectOutputStream and ObjectInputStream and where in the design would one normally apply encryption?
0
Comment
Question by:Suppai
  • 4
  • 3
  • 3
10 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 23660804
>>Can I just wrap the output and input streams with ObjectOutputStream and ObjectInputStream

Yes

What is your objective in encryption - transport level or content level?
0
 

Author Comment

by:Suppai
ID: 23663220
trasnport level. I'm supposed ti use TEA or JSSE.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 23663263
Yes, you can just use http://java.sun.com/javase/6/docs/api/javax/net/ssl/SSLSocketFactory.html to get your sockets. You'll then have a secure transport
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 92

Expert Comment

by:objects
ID: 23664496
thats correct, have a look at the following for details on its usage

http://java.sun.com/docs/books/tutorial/essential/io/objectstreams.html

Let me know if you have any specific questions

0
 
LVL 92

Expert Comment

by:objects
ID: 23664506
one thing you need is that all object implement Serializable

0
 

Author Comment

by:Suppai
ID: 23670679
In my report description TEA is mentioned as a way to do it. I realize that this means writings extensions of the Input/Output streams that encrypts and decrypts the byte streams using a custom TEA encryption class or something like that at least. My question is why would one use that kind of solution instead of the SslSocket solution built in in the java? Because if the easy ssl way is also better or at least as good as the TEA solution I can easily argument pro the java ssl solution in my report.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 23670720
Why code something that's already done for you?
0
 

Author Comment

by:Suppai
ID: 23672033
I couldnt agree more, though I made that clear too:-) So SSL is just as good as TEA? Its different algorithms..and the answer to your question is: because good results in the real world is not necessarily equal to good results in a university project. However as I said if SSL is just as good, knowing my teacher just a little bit, he will be more than happy to see me use a part of the java framework instead.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 750 total points
ID: 23672095
Yes - it's good enough for the banking world, at least ;-)
0
 
LVL 92

Assisted Solution

by:objects
objects earned 750 total points
ID: 23675713
JSSE is not SSL

http://java.sun.com/javase/technologies/security/

It is just a framework for using any number of encryption algorithms.

My experience with the students that I mentor is that if an assignment gives a choice then you are best off justifying why you chose one over the other.

> So SSL is just as good as TEA?

Answering questions like that requires more details on the security requirements :)

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question