I try to it. it still have junk char on it. The thing I try to do is decrypt byte key that w/o using the key. When i test is show me a junk when this code is detele any char that over the 0 to 127 but it not in english.

try
            {
                FileInputStream input = new FileInputStream (filename);
                FileOutputStream output = new FileOutputStream  (filename + ".decrypted");
                int reading;

                System.out.println("Please wait while the file being decrypted");
                Thread.sleep(1500);
                while ((reading = input.read()) != -1)
                {
                     for(int index = 0 ; index < 256; index++)
                     {
                         byte convindex = (byte) index;
                         byte test = (byte) (convindex + reading); 
                        // System.out.println (test);
                         isValidText (test);
                         if (isValidText (test))
                         {
                             output.write (index);
                             output.write (test);
                             break;
                         }
                         System.out.println ("We are done! with 1 for");

                         return; 
                     }
                     public static boolean isValidText (byte test)
        {

            if (test > 0 && test < 127)
            {
                System.out.println (test);
                return true;
            }
            System.out.println ("Hey this false" + test);

            return false;
        }

He pm'd that he thinks isValidText doesn't work, I tried this, works good for me

public class Test{

public static void main(String[] args){
    String s = "Ø";
    byte[] b = s.getBytes();
    System.out.println(isValidText(b));
}


public static boolean isValidText (byte[] test)
        {
            if (test[0] > 0 && test[0] < 127)
            {
                System.out.println (test);
                return true;
            }
            System.out.println ("Hey this false" + test);
            return false;
        }

}

result was

Hey this false[B@1db9742
false
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.