Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #27571

Re: java code

From Stuart <DerTopper@web.de>
Newsgroups comp.lang.java.programmer
Subject Re: java code
Date 2014-02-22 13:57 +0100
Organization A noiseless patient Spider
Message-ID <lea6rt$u7l$1@dont-email.me> (permalink)
References <ac8eddc9-1375-4387-9fe4-89a8a11ef11f@googlegroups.com> <code-20140221034706@ram.dialup.fu-berlin.de> <printing-20140221135713@ram.dialup.fu-berlin.de> <le7kcl$js3$1@dont-email.me> <le9igg$mn$1@dont-email.me>

Show all headers | View raw


On 2/21/2014, Stuart wrote:
 >> It is a pity that Java offers not so many code obfuscation
 >> techniques as C++ does.

On 02/22/14, Joshua Cranmer wrote:
> I disagree, here is some wonderful code obfuscation. Were I more
> involved, I would have tried to find a better obfuscation than roman
> numerals for the main string, but, with any luck, the OP is reading this
> in a client with variable-width font and the text runs together as a
> whole lot of I's.
> public class Test {
>    public static void main(String... args) {
>      char[] K = new char[256];
>      int K = 0, Κ = 0;
>      char[] К = ("ⅠⅠⅠⅠⅠⅠⅠⅠⅢⅢⅢⅢⅢⅢⅤⅣⅠⅢⅢⅢⅢⅢⅢⅢⅢⅡⅥⅠⅠⅢⅢⅢⅢⅢⅢⅢⅢⅢⅢⅡⅡⅡⅢⅤⅣⅠ" +
>        "ⅢⅠⅢⅡⅡⅥⅠⅠⅦⅡⅤⅠⅦⅣⅡⅣⅥⅠⅠⅦⅡⅡⅡⅢⅢⅤⅣⅠⅢⅠⅢⅡⅡⅥⅠⅠⅦⅡⅤⅠⅦⅣⅡⅣⅥⅠⅠⅦⅡⅡⅡⅢⅢⅢⅤⅣⅠⅢⅠⅢⅡⅡ" +
>        "ⅥⅠⅠⅦⅡⅤⅠⅦⅣⅡⅣⅥⅠⅠⅦⅡⅡⅡⅢⅢⅢⅢⅤⅣⅠⅢⅠⅢⅡⅡⅥⅠⅠⅦⅡⅤⅠⅦⅣⅡⅣⅥⅠⅠⅦⅡⅡⅡⅢⅢⅢⅢⅢⅤⅣⅠⅢⅠⅢⅡⅡⅥ" +
>        "ⅠⅠⅦⅡⅤⅠⅦⅣⅡⅣⅥⅠⅠⅦⅡⅡⅡⅢⅢⅢⅢⅢⅢⅤⅣⅠⅢⅠⅢⅡⅡⅥⅠⅠⅦⅡⅤⅠⅦⅣⅡⅣⅥⅠⅠⅦⅡⅡⅡⅢⅢⅢⅢⅢⅢⅢⅤⅣⅠⅢⅠⅢ" +
>
> "ⅡⅡⅥⅠⅠⅦⅡⅤⅠⅦⅣⅡⅣⅥⅠⅠⅦⅡⅡⅡⅢⅢⅢⅢⅢⅢⅢⅢⅤⅣⅠⅢⅠⅢⅡⅡⅥⅠⅠⅦⅡⅤⅠⅦⅣⅡⅣⅥⅠⅠⅦⅡⅡⅡ").toCharArray();
>
>      int Ⲕ = К.length;
>      while (Κ < К.length) {
>        switch (К[Κ]) {
>        case 'Ⅰ': K++; break;
>        case 'Ⅱ': K--; break;
>        case 'Ⅲ': K[K]++; break;
>        case 'Ⅳ': K[K]--; break;
>        case 'Ⅴ': Ⲕ = Κ; if (K[K] == 0) Κ = K(К, Κ); break;
>        case 'Ⅵ': Κ = Ⲕ - 1; break;
>        case 'Ⅶ': System.out.print(K[K]); break;
>        }
>        Κ++;
>      }
>    }
>
>    private static int K(char[] К, int Κ) {
>      int K = 0;
>      for (++Κ; Κ < К.length; Κ++) {
>        if (К[Κ] == 'Ⅴ') K++;
>        else if (К[Κ] == 'Ⅵ' && K-- == 0) return Κ;
>      }
>      return Κ;
>    }
> }

Wow, that's awful.

At first, this code wouldn't run because for some reasons Thunderbird 
treated the K in the lines
     char[] K = new char[256];
and the first K in this line
    int K = 0, Κ = 0;
both as 0x4B, thus making the code erroneous. Or maybe it was one of the 
newsservers that made the substitution.

I never knew that Java allowed Unicode letters in the source code, so I 
even learned something new today.

Thanks for sharing,
Stuart

@Stefan Ram: Sorry, Joshua clearly blew you out of the water...

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

java code "jay'el antonio" <jlantonio10@gmail.com> - 2014-02-20 16:03 -0800
  Re: java code Stuart <DerTopper@web.de> - 2014-02-21 14:29 +0100
    Re: java code Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-02-22 01:10 -0600
      Re: java code Jan Burse <janburse@fastmail.fm> - 2014-02-22 12:36 +0100
      Re: java code Stuart <DerTopper@web.de> - 2014-02-22 13:57 +0100
        Re: java code Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-02-22 12:05 -0600
          Re: java code Stuart <DerTopper@web.de> - 2014-02-22 20:02 +0100
    Re: java code Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2014-02-23 00:52 -0800
  Re: java code Roedy Green <see_website@mindprod.com.invalid> - 2014-02-21 08:55 -0800
  Re: java code lipska the kat <lipskathekat@example.com> - 2014-02-23 09:25 +0000
    Re: java code Lew <lewbloch@gmail.com> - 2014-02-23 20:47 -0800
      Re: java code lipska the kat <lipskathekat@example.com> - 2014-02-24 09:06 +0000
        Re: java code Arne Vajhøj <arne@vajhoej.dk> - 2014-02-24 19:23 -0500
          Re: java code lipska the kat <lipskathekat@example.com> - 2014-02-25 09:22 +0000
            Re: java code Lew <lewbloch@gmail.com> - 2014-02-25 15:08 -0800
              Re: java code lipska the kat <lipskathekat@example.com> - 2014-02-26 08:47 +0000
        Re: java code leif.roar@invalid.com (Leif Roar Moldskred) - 2014-02-25 03:56 -0600
    Re: java code Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2014-02-25 14:54 -0800
      Re: java code lipska the kat <lipskathekat@example.com> - 2014-02-26 09:07 +0000
        Re: java code Simon Lewis <simonlewis2001@gmail.com> - 2014-02-26 12:40 +0100
      Re: java code lipska the kat <lipskathekat@example.com> - 2014-02-26 14:54 +0000
        Re: java code Simon Lewis <simonlewis2001@gmail.com> - 2014-02-26 16:10 +0100
          Re: java code lipska the kat <lipskathekat@example.com> - 2014-02-26 15:45 +0000
            Re: java code Robert Klemme <shortcutter@googlemail.com> - 2014-02-27 14:01 +0100
            Re: java code Simon Lewis <simonlewis2001@gmail.com> - 2014-02-27 14:48 +0100
              Re: java code leif.roar@invalid.com (Leif Roar Moldskred) - 2014-02-27 09:49 -0600
              Re: java code Joerg Meier <joergmmeier@arcor.de> - 2014-02-27 19:24 +0100
          Re: java code Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2014-02-26 12:53 -0800
          Re: java code Lew <lewbloch@gmail.com> - 2014-02-28 16:10 -0800
            Re: java code lipska the kat <lipskathekat@example.com> - 2014-03-01 08:36 +0000
              Re: java code "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-03-01 20:51 +1100
                Re: java code lipska the kat <lipskathekat@example.com> - 2014-03-01 10:31 +0000
                Re: java code "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-03-01 21:44 +1100
                Re: java code lipska the kat <lipskathekat@example.com> - 2014-03-01 10:49 +0000
                Re: java code "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-03-01 21:58 +1100
                Re: java code lipska the kat <lipskathekat@example.com> - 2014-03-01 12:00 +0000
                Re: java code "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-03-02 11:36 +1100
        Re: java code Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2014-02-26 12:59 -0800
    Re: java code David Lamb <dalamb@cs.queensu.ca> - 2014-02-28 20:42 -0500
      Re: java code lipska the kat <lipskathekat@example.com> - 2014-03-01 08:58 +0000
        Re: java code "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-03-01 21:00 +1100
          Re: java code lipska the kat <lipskathekat@example.com> - 2014-03-01 10:45 +0000
            Re: java code "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-03-01 22:04 +1100
              Re: java code lipska the kat <lipskathekat@example.com> - 2014-03-01 12:13 +0000
                Re: java code "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-03-02 11:05 +1100
                Re: java code lipska the kat <lipskathekat@example.com> - 2014-03-02 08:57 +0000
                Re: java code "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-03-02 22:02 +1100
                Re: java code lipska the kat <lipskathekat@example.com> - 2014-03-02 11:57 +0000
                Re: java code leif.roar@invalid.com (Leif Roar Moldskred) - 2014-03-02 06:57 -0600
        Re: java code David Lamb <dalamb@cs.queensu.ca> - 2014-03-02 15:21 -0500
  Re: java code rossum <rossum48@coldmail.com> - 2014-02-26 22:06 +0000
    Re: java code "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-02-27 14:01 +1100
  Re: java code v_borchert@despammed.com (Volker Borchert) - 2014-03-01 19:52 +0000

csiph-web