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. The Lounge
  3. Licence Key Generator

Licence Key Generator

Scheduled Pinned Locked Moved The Lounge
sysadminsecurityhelpquestion
9 Posts 7 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
    James Spibey
    wrote on last edited by
    #1

    Hi, I have been working on a Licence Server application for my company which now works. The only issue is the generation/validation of the licence keys. I have looked into encryption (using blowfish) but the result was a little ugly. I really need to produce a alphanumeric representation of a known alphanumeric string. Can anyone give me any pointers on ways to do this? James

    T C D S N 5 Replies Last reply
    0
    • J James Spibey

      Hi, I have been working on a Licence Server application for my company which now works. The only issue is the generation/validation of the licence keys. I have looked into encryption (using blowfish) but the result was a little ugly. I really need to produce a alphanumeric representation of a known alphanumeric string. Can anyone give me any pointers on ways to do this? James

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      What exactly is the problem? You want to display/transmit your keys as strings with ASCII chars from range 32..127 to avoid strange block-style characters? Tomasz Sowinski -- http://www.shooltz.com

      J 1 Reply Last reply
      0
      • J James Spibey

        Hi, I have been working on a Licence Server application for my company which now works. The only issue is the generation/validation of the licence keys. I have looked into encryption (using blowfish) but the result was a little ugly. I really need to produce a alphanumeric representation of a known alphanumeric string. Can anyone give me any pointers on ways to do this? James

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

        can you turn the output into hex digits? most encryption algorithms (blowfish, des, rsa, etc.) are going to use all 8 bits of the output bytes, so you're not going to get ASCII data on the output side of the encryptor. -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com

        1 Reply Last reply
        0
        • T Tomasz Sowinski

          What exactly is the problem? You want to display/transmit your keys as strings with ASCII chars from range 32..127 to avoid strange block-style characters? Tomasz Sowinski -- http://www.shooltz.com

          J Offline
          J Offline
          James Spibey
          wrote on last edited by
          #4

          Yeah that's about it. I create a text string which consists of the application name, the number of licences and a random non-repeatable number split by pipe(|) symbols such as:- "MyApplication|0010|98598749" I need to encypt this so that I can distribute it to the user to enter into a GUI without them realising what it represents. Is that a little clearer? I'm starting to get a headache already.

          T 1 Reply Last reply
          0
          • J James Spibey

            Yeah that's about it. I create a text string which consists of the application name, the number of licences and a random non-repeatable number split by pipe(|) symbols such as:- "MyApplication|0010|98598749" I need to encypt this so that I can distribute it to the user to enter into a GUI without them realising what it represents. Is that a little clearer? I'm starting to get a headache already.

            T Offline
            T Offline
            Tomasz Sowinski
            wrote on last edited by
            #5

            The weak solution is to use base64 encoding for that (RFC 2045 contains the description). Some smart users may realize what are they typing, so I'd recommend encrypting this with RSA, then using base64. You'll need to use encoding, b/c RSA output will contain non-printable characters. Tomasz Sowinski -- http://www.shooltz.com

            G 1 Reply Last reply
            0
            • J James Spibey

              Hi, I have been working on a Licence Server application for my company which now works. The only issue is the generation/validation of the licence keys. I have looked into encryption (using blowfish) but the result was a little ugly. I really need to produce a alphanumeric representation of a known alphanumeric string. Can anyone give me any pointers on ways to do this? James

              D Offline
              D Offline
              Dark Angel
              wrote on last edited by
              #6

              Can you represent the numbers in hex? ;P

              1 Reply Last reply
              0
              • J James Spibey

                Hi, I have been working on a Licence Server application for my company which now works. The only issue is the generation/validation of the licence keys. I have looked into encryption (using blowfish) but the result was a little ugly. I really need to produce a alphanumeric representation of a known alphanumeric string. Can anyone give me any pointers on ways to do this? James

                S Offline
                S Offline
                Simon Brown
                wrote on last edited by
                #7

                Hi James, I ship a Licence PAK which contains all the fields - Customer Name, Modules Purchased, Special Options etc. and at the end comes a checksum. The checksum is created by concatenating all strings together, taking a 32-bit checksum (I think it's 32 bits) and adding this in hex. So, for example:

                Customer: Plonkers R Us Inc.
                Modules: Sheep, Rabbits & Beans
                Privileges: Naff Off
                Checksum: E3F2-1285-CODE-DEAD

                The customer sees all this, knows what it is all about, and can't mess about otherwise the checksum fails. This idea came from The Digital Equipment Corporation (RIP). Old Simon HB9DRV

                1 Reply Last reply
                0
                • T Tomasz Sowinski

                  The weak solution is to use base64 encoding for that (RFC 2045 contains the description). Some smart users may realize what are they typing, so I'd recommend encrypting this with RSA, then using base64. You'll need to use encoding, b/c RSA output will contain non-printable characters. Tomasz Sowinski -- http://www.shooltz.com

                  G Offline
                  G Offline
                  GogglesPisano
                  wrote on last edited by
                  #8

                  I'd suggest creating a message digest from the entered data using secure hashing algorithm such as SHA-1 or MD5. This gives you either a 16-byte (for MD5) or 20-byte (for SHA1) signature that you can then encode in text form using hexadecimal or base64.

                  1 Reply Last reply
                  0
                  • J James Spibey

                    Hi, I have been working on a Licence Server application for my company which now works. The only issue is the generation/validation of the licence keys. I have looked into encryption (using blowfish) but the result was a little ugly. I really need to produce a alphanumeric representation of a known alphanumeric string. Can anyone give me any pointers on ways to do this? James

                    N Offline
                    N Offline
                    Neville Franks
                    wrote on last edited by
                    #9

                    James, I highly recomend Crypto++ http://www.eskimo.com/~weidai/cryptlib.html for this. You can use something simple like the DefaultEncryptorWithHMAC and Base64 or Hex. This is a very powerfull and extremelly well designed library. One of the best OO C++ designs I've seen. And simple enough to use once you get the hang of it. Like most/all OS projects better docs would help enormously. If you need any help let me know. Neville Franks, Author of ED for Windows http://www.getsoft.com

                    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