
Javascript Generate Random Serial Number
I need a serial number generator and accompanying checker. I would like to be able to set a salt (and maybe a length). The generator should only produce serial numbers that pass the test of the checker.
Those numbers should only account for a small fraction of all the possible numbers of the given length.The algorithm needn't be cryptographically secure. Rather, it should be very easy to implement (in javascript) and it should be very fast.To clarify: If you buy commercial software, it is sometimes protected with a serial number/a key. If you type it in, the software verifies it algorithmically (by checking whether it fulfills certain properties), rather than looking up a huge database. I'm also pretty sure that the keys were all generated algorithmically rather than by hand.
And only a small fraction of all the possible keys of a given length are actually valid so it's hard to guess keys.Salt: I don't know whether salt is the right word, but the algorithm should have at least one parameter, whose choice alters the generated keys (so that multiple people can use the same algorithm and needn't fear collisions). Javascript is primarily a client side language, so everyone will see ur algorithm. (there is ssjs, but who uses it??). Its also SLOW in compare to compiled programs. Whatever you do, the best would be to:.1 generate these keys and save them to a database.2 write a php/java form to read in user imputed key and see if its in the database. This allows for pretty much anything. One way to generate the keys is then to make a random number and get a sha1 or md5 of it (can do more then once to make it true random)–Mar 7 '11 at 9:52.
Random String Generator. This form allows you to generate random text strings. The randomness comes from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs. Jan 30, 2016 The JavaScript function code Math.random/code returns a random floating-point decimal between 0 and 1, uniformly distributed. If you want a random whole number in the range mathm/math to code n/code, including both numbers, you are l.
If there is no real need for security, then here is a very fast serial number generator, with a checker:. User a counter. Initialize it at 0. When you want a new serial number, increment your counter by 1000; the new counter value is the serial number. The checker works like this: a serial number is valid if it ends with three zeros.
RS-16X creates both 2000 & 3000 format '.pgm' file, but you still need a way to transfer it from Mac to MPC. It seems some non-xl & 3000 user are having trouble transferring them. Unfortunately, I don't have much information about this problem at this moment. So, if creating.pgm files is the main reason to use this program, please test the. Rs 16x serial number. The PCIe serial card can be installed into an available PCI Express slot, to provide two high-performance 16C1050 RS232 serial UART channels/ports. It offers a convenient solution for connecting modern or legacy equipment to newer computer systems that don't have RS232 ports. The serial card is compliant with PCI Express 1.0a specification,. Full-swing RS-232 serial, 16x2 character LCD module, RoHS / REACH Compliant, Yellow-Green LED Backlight, FFSTN Negative (Black), Transmissive-20°C to +70°C operation, 6:00 viewing angle. Large easy-to-read LCD in a compact size can display 16 characters x 2 lines. Overall module size is 108.00 mm width x 42.00 mm height x 19.90 mm depth (4.25' x 1.65' x 0.78'). The industry's FIRST add-on 1 serial (16950) adapter for PCI Express.This cutting edge design permits a quick installation of a single RS232 serial to any brand of computer system using either the default Microsoft Windows serial driver or the enhanced Axxon driver. 16x Serial Adapter 16-Port Industrial RS232 to USB 2.0 Hi-Speed Serial Adapter Functionally there’s nothing MINI about the New CG-16COM-MINI RS232 to USB 2.0 serial adapter and its standards performance with industrial-grade construction. 16 RS232 ports all packed into a very small housing.
Only one of every 1000 numbers will be accepted by the checker.If this solution does not please you, then you do have a need for security, and this calls for cryptography.The cryptographically secure solution is to have signed serial numbers: the serial number is the encoding of some payload (e.g. A counter of all serial numbers that you have generated) and a signature over the payload. The generator has a private key, which it uses to compute the signatures; the checker only knows the corresponding public key. The trouble with this setup is not really about verification time, even in Javascript; rather, it is the size of the signature which is a problem. I assume that the serial number will be, at some point, typed by a user. The minimal theoretical size for a cryptographically secure signature is about 80 bits (since signatures can be verified with only the public key, an attacker could try all possible bit sequences, and we usually require a security level of at least 2 80).
However, the smallest signatures among the 'assumed to be secure schemes' are closer to 160 bits (with, which uses a pairing, which is kind of complex to implement) or 320 bits (with or ). There is some work on signature systems with shorter signatures (, or ) but there is quite some controversy on their security.Even with both uppercase letters and digits (36 possible characters, and there you have both 'I' and '1', and also 'O' and '0'), a 160-bit signature will use 31 characters. Along with the payload, you will end up with serial numbers of length 35 or so, which is probably too much for an average user to type in (but not by a large margin; an 80-bit signature would fit nicely).If you do not use a signature scheme, then you must be aware that a reasonably determined attacker will be able, through some disassembly, to circumvent the checker, or even to learn enough to be able to produce his own serial numbers (which the checker will happily accept). At that point, you will not get quantified security: you will not be able to say: 'my scheme is secure up to a budget of 3.8 billion dollars'.
Rather, it will go as: 'my scheme is secure until a sufficiently witty and bored student comes along, reverse-engineers the checker code, and publishes the result on Facebook'.The classical not-really-secure scheme would look like this:. Use the counter from the previous scheme (the one with ends with three zeros). Encode it as a 64-bit block. Encrypt that block with some hardcoded symmetric key, using a block cipher.
The checker knows the key, and verifies the serial number by decrypting it (with the same hardcoded symmetric key) and looking at the final zeros.This is not really more secure than the plain counter, but at least the serial numbers will be random-looking. With an alphabet of 34 characters (digits and uppercase letters except 'O' and 'I'), a 64-bit block requires 13 letters, which is probably acceptable (a typical Microsoft serial number has 25 letters). For the 64-bit block cipher, I recommend, which should be fast and simple enough to implement. If you want the cryptographically secure method you won't get around an internet connection to verify the serial. OP wrote 'it should be very easy to implement (in javascript) and it should be very fast'Its not clear whether 'in javascript' refers to the generator or the checker or both, or whether it refers to 'javascript in the browser', or some other java/ecmascript implementation (e.g.