Results 1 to 8 of 8

Thread: *RESOLVED* Error with Xor in VB.Net

  1. #1

    Thread Starter
    Hyperactive Member hassa046's Avatar
    Join Date
    May 2001
    Location
    Venlo, The Netherlands
    Posts
    336

    Unhappy *RESOLVED* Error with Xor in VB.Net

    Hi folks,

    I've made a cypher class in VB.Net, but every time i run the project i get the following error. What is wrong here???
    An unhandled exception of type 'System.ArgimentException' occured in Microsoft.Visualbasic.dll

    Additional information: Procedure call or argument is not valid.
    On the line self (bold) i get te following description:
    This code has called into another function. When that function is finisched, this is the next statement that will be executed.
    Class:
    Private Sub DoXor()
    dim lngC as integer
    dim intB as integer
    dim lngN as integer

    for lngN = 0 to mvarText.length
    lngC = Asc(Mid(mvarText, lngN,1))
    intB = Int(Rnd * 256)
    >>>Mid(mvarText, lngN,1) = Chr(lngC Xor intB)
    Next
    End sub

    Public Function Decrypt(byval vData as String) as String
    DoXor()
    Decrypt = mvarText
    End Function
    Can please someone help me.

    Thanxxx
    Last edited by hassa046; May 9th, 2005 at 06:49 AM.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I'm not sure if this would help you out but you better see this little demo that uses Xor function .
    http://www.experts-exchange.com/Prog..._20462872.html

  3. #3

    Thread Starter
    Hyperactive Member hassa046's Avatar
    Join Date
    May 2001
    Location
    Venlo, The Netherlands
    Posts
    336
    Originally posted by Pirate
    I'm not sure if this would help you out but you better see this little demo that uses Xor function .
    I took a look at it but it seems a whole other approach. Can you help me to implement my functionalities in that of the example?

    Thanxxx

  4. #4

    Thread Starter
    Hyperactive Member hassa046's Avatar
    Join Date
    May 2001
    Location
    Venlo, The Netherlands
    Posts
    336
    Is there nobody that can help me?
    All the examples that i find can't give me the same result as i use in my own.

    My only question is to look what's wrong with my code.

    Lots of greets
    Ismail

  5. #5
    Lively Member
    Join Date
    Jun 2003
    Posts
    124

    Equiv Logic Statement

    Do you have to use Xor, or can you use an equiv logic stmt

    such as

    a xor b = (a or b) and not (a and b)

    db

  6. #6

    Thread Starter
    Hyperactive Member hassa046's Avatar
    Join Date
    May 2001
    Location
    Venlo, The Netherlands
    Posts
    336
    I've attached the file, to let you see my intention. probably it's self-explaining.

    :-)
    Better to regret things you did, than those you didn't
    International Intelligence

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Why do you post VB6 code here ?? If you still insist to use it though , then I dunno , otherwise , I have Encryption/Decryption routines . They work well . If you want them let me know (but they don't use XOR) .

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Or you may look into using Cryptography class in .NET .

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