SRL Archive - Java Help and Tutorials

Java Text Encryptor. (It is a fail >.>)


mrpickle

2010-01-11 13:00:56

Ok, for the file encrytor I got the main part fixed. People are awsome and helped me :).




I've tested this. It works on Eclipse. Tried it on Ready To Program Java. It fails. I have to make this work on RTP. RTP hates the load part.



Put both files in a folder called "Design" without quotes. Manipulate the save on Main to encrypt whatever other Stiring you like. Very simple encryption & decruption +1 - 1 values.

Nadeem

2010-01-11 18:44:58

If you really are doing you CharConvert like that, it can simply be like:

char CharConvert(char c) { return (char)((byte)c+1); }
As for your file reader, you could've just simply just googled and got enough tutorials and help quick ;) (heres a good one: http://www.javapractices.com/topic/TopicAction.do?Id=42)


~NS

Wizzup?

2010-01-12 11:16:09

From: Nadeem
If you really are doing you CharConvert like that, it can simply be like:

char CharConvert(char c) { return (char)((byte)c+1); }
As for your file reader, you could've just simply just googled and got enough tutorials and help quick ;) (heres a good one: http://www.javapractices.com/topic/TopicAction.do?Id=42)


~NS


A char in java is 16 bits, so you shouldn't cast it to a byte. (Yeah, it's weird…)


char CharConvert(char c) {
return (c + 1) & 65535;
}

mrpickle

2010-01-12 12:19:45

Ok, I got this working on Eclipse after hours of struggling.

Getting it to work on RTP is a different story…




And thanks for the suggestions. I changed to the value manipulation method. Learned a bunch of new commands in the process.

arash

2010-01-13 18:33:55

Why do you use BufferedReader when reading from a text file, just use scanner. It is much less resource intensive.

mrpickle

2010-01-13 22:30:52

Well, the reading method I learned first is BufferedReader, and I used where what I am most familiar with. Scanner I have not yet tried it.