Results 1 to 27 of 27

Thread: Encryption XoR

  1. #1
    DaoK
    Guest

    Encryption XoR

    I use a new algo with a XoR but like in that :
    Code:
    p=blpHb fLg?mEw{fRrw$)f+bIv)"8f+j1"f)#opkSn=m6#/lqrwpyQZnSx>mgTHKHZTrL7f'vpS&pZ`'=>w|"%",D:p,a+q2"KrRA!nfHu9jUãgodbq#—#q›wCfa4#T  b5a f-#5mq|oDj    p?b7v|[
    In the debug.print I can see the text who is over that line but in the text box I only see that :

    Code:
    p=blpHb
    Why ?
    And how can I fix that ?

  2. #2
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Set your text to MultiLine.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  3. #3
    DaoK
    Guest
    Already done that... I think it's because charactere erase some other ? Or maybe not ? I can not figure what's wrong with the Textbox.

  4. #4
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    I cannot test it... cos I don't have the string to do it.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  5. #5
    DaoK
    Guest
    Anyone already had that problem with XoR operation ?

  6. #6
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Have you tried setting that to the text property of a RTB?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  7. #7
    DaoK
    Guest
    I didnt but what it's weird is when I paste the code in the textbox it's ok but the code is not decrypted at all because I think that erase chr.

  8. #8
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Why do you paste it? I don't get what you're trying to do.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  9. #9
    DaoK
    Guest
    I XoR a sentence and in the debug print i see the crypted text but in the textbox i do not see all the text but if i take the text in the debug and I paste it in the text box and xor it the code is decrypted at half so I think than it have a chr who erase something.

  10. #10
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    The only way I can help you is if you post the code (or send it by email [email protected] -I'm at work- ) and tell me the sentence you're trying to encrypt.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  11. #11
    DaoK
    Guest
    ok i have do something when the chr is under 32 than do something but it do not work perfectly so if some one have a solution please write it there.

  12. #12
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    You'll need to change your encryption so that you could never get a chr below 32.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  13. #13
    Addicted Member Rikk's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta
    Posts
    131
    Well said, nishantp.
    Rikk =\=
    Starcraft, Protoss Scout Driver!

  14. #14
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    A richtextbox will display chr$(0) just fine.

    The problem with it isn't actually a windows problem as nishantp stated. VB was built on C++, thus it inherits flaws. As you may know chr$(0) is null, C++ intreprets this as end of string. That's why anything after is is ignored. Possible solutions, as I stated one before richtext, another is converting to hex.

    When you convert though make sure you either use format or string(2-len(hex),"0") & hex, otherwise you'd get a truncated string which would be extremely hard to decrypt, especially for a program. To do it you'd have to do redundency checking, to see if it's really just one character or two... which would mean your characters would have to have the values stored in them.

    Say I have hi,

    asc(h)=104
    lastchar = 0
    104 xor lastchar xor 1 = 105
    lastchar = 105
    asc(i) = 105
    asc(i) xor lastchar xor 2 = 2

    or..

    you could split up values
    < 128 = 1
    > 128 = 0

    then mark the length for each hex values...

    as you can see this gets long and complicated...

    Richtext is the way to go!

  15. #15
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by DiGiTaIErRoR
    A richtextbox will display chr$(0) just fine.

    ....

    Richtext is the way to go!
    I've proposed that before...
    Originally posted by Mc Brain
    Have you tried setting that to the text property of a RTB?
    But, he didn't care to try it.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  16. #16
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Great minds think alike Mc Brain.


  17. #17
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by DiGiTaIErRoR
    Great minds think alike Mc Brain.

    Yeah... I couldn't agree more -in the great mind stuff -
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  18. #18
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Perhaps better stated.. great Brains.


  19. #19
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Ok, I could have agreed more.... I agree more now!

    BTW, did that solve your problem, DaoK? If not... just change the encrypting algorithm.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  20. #20
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    Originally posted by DaoK
    OK I can not solve the problem at 100% but it work at 50%.

    here is a test to try to crack my XoR encryption.

    Code:
    $#7iIz+v'#>b5w7vHl(
    The message will be like that : HelLO yOu i Am YOUr fRIend

    This is just an example because I do not know why it do that but it freak out all chr...Try to crack the txt in the code quote and tell me if you crack it how you did.
    are you going to post a test program, compiled, so that i can try some things out?

  21. #21
    DaoK
    Guest
    ok I will try RTB but I wanted to use a Textbox to have the least possbile OCX in my project.

  22. #22
    DaoK
    Guest
    are you going to post a test program, compiled, so that i can try some things out?
    Maybe yes and maybe no, I need to work a little on it than maybe. The algo is better of my last one I am proud of it

  23. #23
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    so post the program!

  24. #24
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    in compiled form, so we have something to work with!

  25. #25
    DaoK
    Guest
    Wait! With a richtextbox it doesnt work, lets me work on it and I will come back to give you some news.

  26. #26
    DaoK
    Guest
    I have solve my problem, I want to thx all who helped me.

    If someone is interested the problem was for an unknown reason a move of 32 chr each letter that why all capital letter changed and some time double line didnt work. Anyway, thx you all

  27. #27
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    post a program for us to test the encryption!

Posting Permissions

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



Click Here to Expand Forum to Full Width