Results 1 to 7 of 7

Thread: A REALLY Tough Math Problem

  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

  2. #2

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

    Exclamation

    *BUMP*
    Alphanos

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    hmm..

    this seems similar to a famous encryption?

    am i warm or arctic?

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    I'm in front of the computer.
    Posts
    270
    I don't know. If it is, its purely coincidental, I wrote it myself. So if you can (or can't) crack it, I'd like to know.
    Alphanos

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    I'm in front of the computer.
    Posts
    270
    LOL @ da_silvy, >4000 posts and a "Newbie Member".
    Alphanos

  6. #6
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527


    so you want me to nut it out?

    not using computer to just run thru all the possibilities?

    we'll see

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    I'm in front of the computer.
    Posts
    270
    LOL, I think using a computer would be kinda necessary to figure it out (if there is a solution), unless you happen to know exactly how VB's random number generator works.
    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