Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Understanding of encryption part from source code

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Understanding of encryption part from source code

    hello guys

    i need your help in something
    i'm trying now with a java program .i dont have the source code .i need to get it to run.
    i found some strings in the classes that seems to be some sort of encrypted text,even i'm sure it is some sort of encrypted text .
    i need your help to point out me on how to know what sort of encryption has been used in it ,or may be you know what it is .
    the code seem to be addressing a URL and i need to know it and how to change it
    please try to have a look at it and tell me i need to crack this encrypted text and change it.

    public static final void w()
        {
            String s1 = "[COLOR=Red]wr?\037\021he*B\025#y&Y\016i95^[/COLOR]";
            String s2 = "[COLOR=Red]hp>D\017h[/COLOR]";
            String s3 = "[COLOR=Red]lb[/COLOR]";
            try
            {
                if(u_java_lang_String_static_fld == null)
                    u_java_lang_String_static_fld = ar();
                com.diginet.oldchat.server.a.q_boolean_static_fld = !q((new StringBuilder()).append("http://").append(ChatServer.q(s1)).append("/").append(ChatServer.q(s2)).append("/").append(ChatServer.q(s3)).append("/").append(u_java_lang_String_static_fld.hashCode()).append(".html").toString());
                return;
            }
            catch(Exception _ex)
            {
                com.diginet.oldchat.server.a.q_boolean_static_fld = true;
            }
        }
     
        private static boolean q(String s1)
        {
            if((s1 = (HttpURLConnection)(s1 = new URL(s1)).openConnection()).getResponseCode() == 200)
                return true;
            try
            {
                System.out.println((new StringBuilder()).append("Resp:").append(s1.getResponseCode()).toString());
                return false;
            }
            // Misplaced declaration of an exception variable
            catch(String s1)
            {
                System.err.println((new StringBuilder()).append("hUC failed! E=").append(s1.getMessage()).toString());
            }
            return false;
        }
     
        public static void aq(String s1)
        {
            new ArrayList();
            ArrayList arraylist = null;
            (arraylist = new ArrayList()).add(ChatServer.q("[COLOR=Red]?'~\005R<9v\031R#%v\033[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]?'~\005T<9u\032P#&t\030[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]?'~\005R<9v\031R#!q[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]?'~\005R<9v\031R#!\177[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]?'~\005R<9v\031S#$s[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]:%i\036S#&q\036O</[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]:%i\036S#&~\030O<'~[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]:#i\036R#&~\034O</[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]:#i\023W##q\005P9![/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]:#i\023W##q\005P9 [/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]:#i\023W#&u\031O< ~[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]:#i\023W#&u\031O< \177[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]; i\031S59u\032O?#s[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]:#i\023W##q\005P9/[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]5/i\023P#%r\032O</[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]; i\031S59~\034O>#[/COLOR]"));
            arraylist.add(ChatServer.q("[COLOR=Red]4&i\032X59r\033O<&s[/COLOR]"));
            arraylist = arraylist;
            try
            {
                boolean flag = false;
                for(int i1 = 0; i1 < arraylist.size(); i1++)
                {
                    String s2 = ((String)arraylist.get(i1)).toString();
                    if(s1 != null && !"".equals(s1) && (s2.equals(s1) || InetAddress.getByName(s1).getHostAddress().equals(s2) || InetAddress.getByName(s2).getHostName().equals(s1)))
                        flag = true;
                }
     
                if(!flag)
                    throw new StreamCorruptedException("");
                else
                    return;
            }
            catch(Exception _ex)
            {
                throw new StreamCorruptedException("");
            }
        }

    the strings in red are the one that i think encrypted
    if you guys need any further code tell me
    thank you in advance


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: need help

    I'm not so sure about this one, what are your intentions exactly?

    If you don't have the source how do you intend to change the URL in the actual code?

    // Json

  3. #3
    Junior Member
    Join Date
    Jul 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: need help

    i can edit it with any hex editor
    here is another part of the code that i think it might help
     private static String w(String s1, String s2)
        {
            s1 = new URL(s1);
            s1 = new DataInputStream(s1.openStream());
            String s3;
            for(s3 = ""; s3.toLowerCase().indexOf(s2) < 0; s3 = s1.readLine());
            s1 = (s1 = Pattern.compile("(\\d{1,3}\\.){3}\\d{1,3}")).matcher(s3);
            s2 = "";
            if(s1.find())
                s2 = s1.group();
            u_java_lang_String_static_fld = s2;
            return s2;
        }
     
        public static String ar()
        {
            if(u_java_lang_String_static_fld != null)
                return u_java_lang_String_static_fld;
            String s1;
            try
            {
                if((s1 = w(s1 = ChatServer.q("ec3[[\"80\\\026#d/D\026 z>\006\b}9$D\f"), "title")) == null || "".equals(s1))
                    throw new Exception();
                else
                    return s1;
            }
            catch(Exception _ex) { }
            try
            {
                if((s1 = w(s1 = ChatServer.q("ec3[[\"80\\\026#g5D\031ts\"_\004nciH\016`"), ChatServer.q("tx2YAdggJ\005ie\"X\022"))) == null || "".equals(s1))
                    throw new Exception();
                else
                    return s1;
            }
            catch(Exception _ex) { }
            try
            {
                if((s1 = w(s1 = ChatServer.q("ec3[[\"80\\\026#~7\006\000ie\"X\022#t(F"), ChatServer.q("`ngB\021-v#O\023hd4\021"))) == null || "".equals(s1))
                    throw new Exception();
                else
                    return s1;
            }
            catch(Exception _ex)
            {
                return "";
            }
        }

  4. #4
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: need help

    I don't recognise that encryption.

    If you don't have all the source code, then what are you looking to do with this exactly?

    Are you wanting to run this with your own URL or are you looking to find out what the encrypted URL is?
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  5. #5
    Junior Member
    Join Date
    Jul 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: need help

    thanks for response
    actually both ; i need first to know what it is calling and what is the url
    and then i'll see if i can change it to work with mine or anything i choose .
    as i read it might be some sort of serialized method .i thought you guys might help me out.
    anyway if some one can i'll be very thankful as i'm working on it since two months.
    thanks in advance.