This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Encrypt/Decrypt Write/Read To/From a File

 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know how to write to a file an encrypted piece of data. I also need to know how to read a file and decrypt the data. For network programming, I use "SSL_DH_anon_WITH_RC4_128_MD5" type encryption for my network projects. Is there something similar or can I use this for files?

Thanks,
John Price
 
Rob Spoor
Sheriff
Pie
Posts: 20550
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The usual way is to create a javax.crypto.Cipher and use that with a CipherInputStream / CipherOutputStream.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic