Hi all!
Gonna be straight here: I need help coding a program in Java that can encrypt or decrypt a file. I am using ASCII values as my form of encryption. It is too late to change that. Is it possible to parse a file to String?
Thanking you!
Encryption & Decryption Program
Encryption & Decryption Program
"Because I don't say it...don't mean I ain't thinking it!"
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank
Re: Encryption & Decryption Program
cuz you can always go and google and read over here.
http://download.oracle.com/javase/1.4.2 ... Guide.html
allows you to encrypt directly from a file stream. Which is what I used to use. but it is quick and dirty.
http://download.oracle.com/javase/1.4.2 ... Guide.html
allows you to encrypt directly from a file stream. Which is what I used to use. but it is quick and dirty.
- Spoiler (show)
-
- Registered User
- Posts: 14338
- Joined: 04 Sep 2004, 02:00
- Processor: i386DX Sooper
- Motherboard: A blue one
- Graphics card: A red one
- Memory: Hard drive
- Location: On a Möbius strip
- Contact:
Re: Encryption & Decryption Program
Byte array.Rajiv wrote: parse a file to String?
EDIT: Although the better method would be opening two file streams, and reading bits from the source stream, and encrypting it and writing it directly to the destination stream.
(As opposed to loading the whole thing into RAM ( ), encrypting, and writing the whole thing to a stream again)
If I weren't insane: I couldn't be so brilliant! - The Joker
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank
Re: Encryption & Decryption Program
Agree with Bladerunner I do... better to go through the file with a buffered stream than to read the whole file at once. What are you going to do if you get a file that is say... 300MB in size?
- Spoiler (show)
-
- Registered User
- Posts: 14338
- Joined: 04 Sep 2004, 02:00
- Processor: i386DX Sooper
- Motherboard: A blue one
- Graphics card: A red one
- Memory: Hard drive
- Location: On a Möbius strip
- Contact:
Re: Encryption & Decryption Program
Nevermind 300MB, try 8GB+RuadRauFlessa wrote:Agree with Bladerunner I do... better to go through the file with a buffered stream than to read the whole file at once. What are you going to do if you get a file that is say... 300MB in size?
I wrote a file splitter once to split some game ISOs.
If I weren't insane: I couldn't be so brilliant! - The Joker
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank