Results 1 to 4 of 4
  1. #1
    Pretender is offline Member
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Question Java + Cryptography

    Hello Everybody,

    I was signing up to another forum for java then it gave me questions to complete my registration.
    (I couldn't answer so I came here looking for another forum :P)
    But here is the question:
    Java Code:
    int l = 2;
          int y = "QCZ".hashCode() % 3000;
          int u = "KRL".hashCode() % 3000;
          for (int q = 0; q <= u; q++)
             l = (l ^ q) % y;
          return l;
    Question 1: What is the returned value?



    Question 2: What is the greatest common divisor of the previous two results?

    So the returned value would be 2, right?

    Okay, but about the code in General: hash.Code()
    I take it this has done a little 'crypt' in a hash right?
    So this means Cryptography is possible in Java...
    I am wondering if Java is powerful enough to create a FUD Crypter?

    But also I am curious about question 2, if anybody could help me I would enjoy that :3

    I'm not sure where this should go so I put this thread here.
    Thanks, Pretender.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: Java + Cryptography

    Question 1: What is the returned value?
    The easiest way is to write some code and see.

    Java Code:
    public class Foo {
        public static void main(String[] args) {
            int l = 2;
            int y = "QCZ".hashCode() % 3000;
            int u = "KRL".hashCode() % 3000;
            for (int q = 0; q <= u; q++) {
               l = (l ^ q) % y;
            }
            //return l;
            System.out.println(l);
        }
    }
    In Java hashCode() returns an integer value can be "associated" with whatever it is called on. It has some reliable properties described in the Object API docs - and the particular int returned for strings like "QCZ" is described in the String documentation.

    There's a bit of an introduction to hash values and what they might be used for in Wikipedia.

    Question 2: What is the greatest common divisor of the previous two results?
    What are the previous two results?

  3. #3
    Pretender is offline Member
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Default Re: Java + Cryptography

    But can I ask - Does this mean its possible to make a crypter in Java?

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: Java + Cryptography

    There are encryption libraries and software written in Java. And I guess you could write your own. The prerequisites would seem to be a reasonable grasp of basic Java (easy) and as much mathematics as you care to throw at the problem (unboundedly difficult, but fun).

    A little googling reveals that FUD=="fully undetectable" and that the aim seems to be to encrypt executables to make malware undetectable by the end user. If that's your aim - and I hope not - this is probably not the right place to get help, as most here would regard that as a waste of effort (and talent, although judging from the sites distributing this stuff most of the 1337ness seems to reside in passing on and "modding" other people's efforts.)

Similar Threads

  1. Legion of the Bouncy Castle Java Cryptography API 1.47
    By java software in forum Java Software
    Replies: 0
    Last Post: 03-31-2012, 07:49 PM
  2. java.util.jar and cryptography
    By telltera in forum New To Java
    Replies: 1
    Last Post: 09-30-2010, 09:54 AM
  3. Legion of the Bouncy Castle Java Cryptography API 1.39
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-03-2008, 05:27 PM
  4. Legion of the Bouncy Castle Java Cryptography API 1.38
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 11-12-2007, 06:53 PM
  5. Replies: 0
    Last Post: 06-16-2007, 10:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •