Page 3 of 3 FirstFirst 123
Results 41 to 51 of 51
  1. #41
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,828
    Rep Power
    19

    Default

    Get each char, cast to byte?
    It all depends how it's transmitted.

  2. #42
    funstein is offline Member
    Join Date
    Aug 2011
    Posts
    24
    Rep Power
    0

    Default ..

    Can you tell me a way of converting ASCII numbers to a string? Every method I try, it takes it as unicode and returns chinese.

  3. #43
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,828
    Rep Power
    19

    Default

    Because they aren't ascii numbers by that point.
    You are converting char characters and (by the way the encryption in PHP worked) the rollover at 0 (and 256) is not happening...because Java chars are Unicode, not ASCII. So they are simply heading into the far end of the Unicode range, which'll give you the likes of Chinese.

    You need to be working with bytes, not chars, in the decrypter.

  4. #44
    funstein is offline Member
    Join Date
    Aug 2011
    Posts
    24
    Rep Power
    0

    Default

    Oh. I think I get it. But still, can you change a portion of the code and send it?

  5. #45
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,828
    Rep Power
    19

    Default

    No I can't, unless you plan on paying my client for my time...
    There is no way I can spend the time analysing it to produce a meaningful result.

  6. #46
    funstein is offline Member
    Join Date
    Aug 2011
    Posts
    24
    Rep Power
    0

    Default

    OK, just tell me how to convert an ASCII byte into a character in JAVA.

  7. #47
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,828
    Rep Power
    19

    Default

    Assuming the things you receive (and I have no idea how you;re receiving this stuff) are ASCII, then you should be able to simply cast the char to a byte.
    As I said earlier.

  8. #48
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    If you could post the intput to and the output from the PHP code perhaps someone could figure out the algorithm being used.

  9. #49
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,828
    Rep Power
    19

    Default

    Sounds like the algorithm relies on the way PHP rolls over on a byte (an ASCII char).

  10. #50
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Hopefully that could be determined and accounted for in a java program.

  11. #51
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,828
    Rep Power
    19

    Default

    I would have thought so, hence my suggestion of casting char to byte and seeing if that worked.
    Of course then the Java to Java one won't work without doing the same thing on the encrypt side. But the OP should be able to handle all this.

Page 3 of 3 FirstFirst 123

Similar Threads

  1. problem with encryption in steganography
    By stegano in forum New To Java
    Replies: 2
    Last Post: 02-26-2011, 01:10 PM
  2. Java encryption problem
    By lqu in forum Advanced Java
    Replies: 0
    Last Post: 01-24-2011, 04:30 AM
  3. OAEP Padding Problem by encryption
    By Buhmann in forum Advanced Java
    Replies: 1
    Last Post: 09-07-2009, 01:19 PM
  4. WebService encryption problem
    By falnik in forum Advanced Java
    Replies: 3
    Last Post: 07-26-2009, 04:21 AM
  5. Encryption-Decryption Problem
    By dinesh.1.sharma in forum Advanced Java
    Replies: 1
    Last Post: 07-17-2008, 10:03 PM

Posting Permissions

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