• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Securing a JAVA chat client with RSA

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello:

I have a simple java chat client that I would like to secure using RSA.

I have knowledge of how RSA works, but I am having trouble implementing it from JAVA.

If I need to obtain the Public Key from the server that my client connects to, do I need to have the ChatServer.java script obtain the Public Key from the server and then have my chatClient.java script grab that Public Key?

Please help, I need some direction.

 
Sheriff
Posts: 22796
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps you can use javax.crypto.Cipher for this. With such a Cipher you can use CipherInputStream and CipherOutputStream around your sockets' streams, and the API will take care of the encryption for you.

java.security.Key, used with Cipher, has sub interfaces like RSAPublicKey and RSAPrivateKey so I'm quite sure Cipher could be used with RSA. A little browsing through the API may be able to help you further along the right path.
 
Joanna Spence
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your help.

Ok I am reading the API on the classes you suggested.

If I know that the server is storing the public key somewhere...how would I obtain that with the chatclient.java script?

Would you like me to the post the code that I have so far?
 
Marshal
Posts: 7254
1395
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Elmira Love", please check your private messages regarding an important administrative matter.
 
Your buns are mine! But you can have this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic