This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Encrypt/Decrypt Write/Read To/From a File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Encrypt/Decrypt Write/Read To/From a File" Watch "Encrypt/Decrypt Write/Read To/From a File" New topic
Author

Encrypt/Decrypt Write/Read To/From a File

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

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


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20077
    
  30

The usual way is to create a javax.crypto.Cipher and use that with a CipherInputStream / CipherOutputStream.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
Have you checked out Aspose?
 
subject: Encrypt/Decrypt Write/Read To/From a File
 
It's not a secret anymore!