Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Suggest a fast way to do?

Suggest a fast way to do?

Scheduled Pinned Locked Moved C / C++ / MFC
question
30 Posts 11 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    john5632
    wrote on last edited by
    #1

    I have a CRC code for particuler string. I need to get the string corssspoding to CRC. My mean to say I need to generate all possible combination of string from lenght 1 to n untill I get the desired CRC value. I know, string may be different from original one. How can I acoomplish this in a fast way?

    L C S C J 6 Replies Last reply
    0
    • J john5632

      I have a CRC code for particuler string. I need to get the string corssspoding to CRC. My mean to say I need to generate all possible combination of string from lenght 1 to n untill I get the desired CRC value. I know, string may be different from original one. How can I acoomplish this in a fast way?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You can't, CRC is one way only: see here[^].

      Unrequited desire is character building. OriginalGriff

      J 1 Reply Last reply
      0
      • L Lost User

        You can't, CRC is one way only: see here[^].

        Unrequited desire is character building. OriginalGriff

        J Offline
        J Offline
        john5632
        wrote on last edited by
        #3

        I am getting the desired string which generate given CRC but it slow because I am generating string from length 1 to n. Is there a way to make it faster? Or Can I get the string legnth from CRC?

        L 1 Reply Last reply
        0
        • J john5632

          I am getting the desired string which generate given CRC but it slow because I am generating string from length 1 to n. Is there a way to make it faster? Or Can I get the string legnth from CRC?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          john5632 wrote:

          Is there a way to make it faster?

          It's unlikely, given that you have to try every possible combination.

          john5632 wrote:

          Can I get the string legnth from CRC?

          No, it's a one-way value.

          Unrequited desire is character building. OriginalGriff

          J 1 Reply Last reply
          0
          • L Lost User

            john5632 wrote:

            Is there a way to make it faster?

            It's unlikely, given that you have to try every possible combination.

            john5632 wrote:

            Can I get the string legnth from CRC?

            No, it's a one-way value.

            Unrequited desire is character building. OriginalGriff

            J Offline
            J Offline
            john5632
            wrote on last edited by
            #5

            But I read somwhat like this somewhere that do some opeartion with calculated CRC untill we get zero? Is there something like this?

            L enhzflepE 2 Replies Last reply
            0
            • J john5632

              I have a CRC code for particuler string. I need to get the string corssspoding to CRC. My mean to say I need to generate all possible combination of string from lenght 1 to n untill I get the desired CRC value. I know, string may be different from original one. How can I acoomplish this in a fast way?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Do you know what CRCs are for? They are for checking the validity of the data, to make sure it hasnt got corrupted. It is not a representation of the data, it is merely a numerical sum of the data. Therefore you cannot reconstruct the data from the CRC. If you wanted to know all the strings that could create a particular check sum you would have to run through all the permutations and calculate the sum.

              ============================== Nothing to say.

              J 1 Reply Last reply
              0
              • J john5632

                But I read somwhat like this somewhere that do some opeartion with calculated CRC untill we get zero? Is there something like this?

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                john5632 wrote:

                But I read somwhat like this somewhere

                Well I guess you need to use Google to find the reference again.

                Unrequited desire is character building. OriginalGriff

                1 Reply Last reply
                0
                • L Lost User

                  Do you know what CRCs are for? They are for checking the validity of the data, to make sure it hasnt got corrupted. It is not a representation of the data, it is merely a numerical sum of the data. Therefore you cannot reconstruct the data from the CRC. If you wanted to know all the strings that could create a particular check sum you would have to run through all the permutations and calculate the sum.

                  ============================== Nothing to say.

                  J Offline
                  J Offline
                  john5632
                  wrote on last edited by
                  #8

                  I know I can not construct data from CRC, my aim is to get the string which generate the same CRC value

                  E D L 4 Replies Last reply
                  0
                  • J john5632

                    I have a CRC code for particuler string. I need to get the string corssspoding to CRC. My mean to say I need to generate all possible combination of string from lenght 1 to n untill I get the desired CRC value. I know, string may be different from original one. How can I acoomplish this in a fast way?

                    C Offline
                    C Offline
                    CPallini
                    wrote on last edited by
                    #9

                    What kind of CRC you are dealing with?

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    J 1 Reply Last reply
                    0
                    • C CPallini

                      What kind of CRC you are dealing with?

                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                      [My articles]

                      J Offline
                      J Offline
                      john5632
                      wrote on last edited by
                      #10

                      CRC32

                      A G 2 Replies Last reply
                      0
                      • J john5632

                        I know I can not construct data from CRC, my aim is to get the string which generate the same CRC value

                        E Offline
                        E Offline
                        Emilio Garavaglia
                        wrote on last edited by
                        #11

                        I don't know if it is just a typo but ... your aim is impossible to get. There are infinite strings that can give the same CRC. So first start to think as "plural", then ... the only way is "try/retry/retry ...." until you retain to have enough of them.

                        2 bugs found. > recompile ... 65534 bugs found. :doh:

                        1 Reply Last reply
                        0
                        • J john5632

                          CRC32

                          A Offline
                          A Offline
                          App_
                          wrote on last edited by
                          #12

                          crc32 here and here

                          1 Reply Last reply
                          0
                          • J john5632

                            CRC32

                            G Offline
                            G Offline
                            Goto_Label_
                            wrote on last edited by
                            #13

                            this crc32 ?

                            1 Reply Last reply
                            0
                            • J john5632

                              I have a CRC code for particuler string. I need to get the string corssspoding to CRC. My mean to say I need to generate all possible combination of string from lenght 1 to n untill I get the desired CRC value. I know, string may be different from original one. How can I acoomplish this in a fast way?

                              S Offline
                              S Offline
                              Software_Developer
                              wrote on last edited by
                              #14

                              Lookup tables are fast.

                              J 1 Reply Last reply
                              0
                              • S Software_Developer

                                Lookup tables are fast.

                                J Offline
                                J Offline
                                john5632
                                wrote on last edited by
                                #15

                                how table will be fast?

                                S 1 Reply Last reply
                                0
                                • J john5632

                                  I know I can not construct data from CRC, my aim is to get the string which generate the same CRC value

                                  D Offline
                                  D Offline
                                  David Crow
                                  wrote on last edited by
                                  #16

                                  john5632 wrote:

                                  ...my aim is to get the string which generate the same CRC value

                                  So are you wanting help with permutations or creating a CRC? Those are two unrelated tasks.

                                  "One man's wage rise is another man's price increase." - Harold Wilson

                                  "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                                  "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

                                  J 1 Reply Last reply
                                  0
                                  • D David Crow

                                    john5632 wrote:

                                    ...my aim is to get the string which generate the same CRC value

                                    So are you wanting help with permutations or creating a CRC? Those are two unrelated tasks.

                                    "One man's wage rise is another man's price increase." - Harold Wilson

                                    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                                    "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

                                    J Offline
                                    J Offline
                                    john5632
                                    wrote on last edited by
                                    #17

                                    yes

                                    D 1 Reply Last reply
                                    0
                                    • J john5632

                                      yes

                                      D Offline
                                      D Offline
                                      David Crow
                                      wrote on last edited by
                                      #18

                                      So then why not focus on a much smaller problem? Trying to build the space shuttle in one setting will never work. You need to build it in pieces. When each of those smaller pieces are working, your overall problem will be solved.

                                      "One man's wage rise is another man's price increase." - Harold Wilson

                                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                                      "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

                                      1 Reply Last reply
                                      0
                                      • J john5632

                                        I have a CRC code for particuler string. I need to get the string corssspoding to CRC. My mean to say I need to generate all possible combination of string from lenght 1 to n untill I get the desired CRC value. I know, string may be different from original one. How can I acoomplish this in a fast way?

                                        C Offline
                                        C Offline
                                        Chuck OToole
                                        wrote on last edited by
                                        #19

                                        I have read through this chain (I was going to say 'string' but that would only confuse the issue) You have to understand folks here, many are just as curious about the 'why' as about the 'how'. You haven't answered 'why are you doing this?' To many, myself included, you have embarked on a totally useless exercise. Why in the world would you want a random string of characters that happens to generate the same CRC32 that you already have in your hand? You cannot possible reconstruct the original string so of what interest is a random string with the same CRC32. Unless you are trying to fool some other program who knows the CRC32 of the data it wants and you are trying to pump some junk at it for some amusing or nefarious reason. So, tell us 'why' you need such a string, you may find some folks who find the problem more interesting than it seems so far.

                                        C 1 Reply Last reply
                                        0
                                        • C Chuck OToole

                                          I have read through this chain (I was going to say 'string' but that would only confuse the issue) You have to understand folks here, many are just as curious about the 'why' as about the 'how'. You haven't answered 'why are you doing this?' To many, myself included, you have embarked on a totally useless exercise. Why in the world would you want a random string of characters that happens to generate the same CRC32 that you already have in your hand? You cannot possible reconstruct the original string so of what interest is a random string with the same CRC32. Unless you are trying to fool some other program who knows the CRC32 of the data it wants and you are trying to pump some junk at it for some amusing or nefarious reason. So, tell us 'why' you need such a string, you may find some folks who find the problem more interesting than it seems so far.

                                          C Offline
                                          C Offline
                                          Chris Losinger
                                          wrote on last edited by
                                          #20

                                          Chuck O'Toole wrote:

                                          Unless you are trying to fool some other program who knows the CRC32 of the data it wants and you are trying to pump some junk at it for some amusing or nefarious reason.

                                          seems likely, to me.

                                          image processing toolkits | batch image processing

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups