Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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: 20608
63
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