Results 1 to 7 of 7

Thread: A REALLY Tough Math Problem

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    I'm in front of the computer.
    Posts
    270

    Cool A REALLY Tough Math Problem

    Given the following algorithm...

    Code:
    Private Sub InitCrypt()
           Dim i As Long
           Dim i2 As Long
           Dim TempNum As Long
           
           TotalASCII = 0 ' a module-level long variable
           ThreadNum = 0 ' a module-level long variable
           
           For i = 0 To (PassLength - 1)
                  Rnd -1
                  Randomize (bytPassword(i) * (1 + (i * 0.5)))
                  TempNum = (Rnd * 10000) * (1+ (i * 0.5))
                  i2 = i2 + TempNum
           Next i
           TotalASCII = i2 \ 8 \ PassLength
           
           ThreadNum = (TotalASCII * 0.5) + (PassLength * 2)
           
           ReDim Threads(1 To ThreadNum) As Long
           
           i2 = TotalASCII \ 8 \ PassLength
           
           Rnd -1
           Randomize TotalASCII
           
           For i = 1 To ThreadNum
                  Threads(i) = (i * i2 * ((Rnd * 100) And 127)) + TotalASCII
           Next i
           
           Threads(1) = (Threads(1) + lngPrimes(Threads(ThreadNum) And 255)) And 255
           For i = 1 To (ThreadNum - 1)
                Threads(i + 1) = (Threads(i + 1) + lngPrimes(Threads(i) And 255)) And 255
           Next i
    End Sub

    Find two bytPassword arrays that will
    -generate the same ThreadNum
    -generate at least 50% of the same values in the Threads array

    Additional info:
    -this is for an encryption algorithm
    -bytPassword is simply a byte array of the ascii codes in the password
    -PassLength is the ubound of bytPassword +1
    -lngPrimes is an array containing the first 256 prime numbers (0 to 255). That starts at 1, then 2, 3, 5, etc.
    -bytPassword should contain 4-128 elements
    -at least one of the two bytPassword arrays found to be equal should be composed of characters that people would normally type, if possible.

    Good luck.
    Last edited by Alphanos; Dec 13th, 2001 at 04:31 PM.
    Alphanos

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