jQuery in Action, 2nd edition*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 19654
    
  18

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
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Encrypt/Decrypt Write/Read To/From a File
 
Similar Threads
Can anyone help?
Need to write java code for encryption and decryption of a file.
Need Help in Encryption
Write bufferedreader to a file
String encryption/decryption - 'block not properly padded' error