Jan 4, 2018 06:22 PM
(This post was last modified: Jan 4, 2018 06:23 PM by Barret.)
Before i start, this is in no way secure, its merely a simple demo of a random generated key that has a super simple algorithm that can be verified on both ends.
It was just for fun, has no real purpose, i just felt like making this, sometimes you just do stuff with absolutely no reason at all. 🤫
It begins by generating a random number between 10 ~ 99 this is called the factor.
Next it starts to create the number blocks, these consist out of 1 real and 3 fake numbers, the first number is used as accumulator,
it keeps looping and adding these blocks until the accumulator reaches the equal sum of the factor or beyond, if it is beyond the factor it makes a correction number.
The factor has to be a 2-digit number the correction number does not, however it will be padded by 0's to make a 4-digit number.
Example:
Key: [10|02]-3000-2000-1000-3000-2000 (assume the zero's are random generated)
Remark: This also means the key is never a fixed length
Few keys generated by the code:
Source: https://gist.github.com/TheBarret/644cac...54366da41c
Perhaps useless to some, maybe useful for others, that i leave up to you.
It was just for fun, has no real purpose, i just felt like making this, sometimes you just do stuff with absolutely no reason at all. 🤫
It begins by generating a random number between 10 ~ 99 this is called the factor.
Next it starts to create the number blocks, these consist out of 1 real and 3 fake numbers, the first number is used as accumulator,
it keeps looping and adding these blocks until the accumulator reaches the equal sum of the factor or beyond, if it is beyond the factor it makes a correction number.
The factor has to be a 2-digit number the correction number does not, however it will be padded by 0's to make a 4-digit number.
Example:
Key: [10|02]-3000-2000-1000-3000-2000 (assume the zero's are random generated)
Code
[3]000
[2]000
[1]000
[3]000
[2]000
--------------
[12]000 - correction(2) = factor(10)Few keys generated by the code:
Code
1502-8360-8836-1743 = (8 + 8 + 1) - 2 = 15
3305-7469-3906-8181-6321-4190-6322-4643 = (7 + 3 + 8 + 6 + 4 + 6 + 4) - 5 = 33Source: https://gist.github.com/TheBarret/644cac...54366da41c
Perhaps useless to some, maybe useful for others, that i leave up to you.




![[Image: giphy-2-1.gif]](https://nextshark-vxdsockgvw3ki.stackpathdns.com/wp-content/uploads/2017/12/giphy-2-1.gif)