Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[Just for Fun] Key Generator with a very simple Algorithm

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)

Code
 [3]000
 [2]000
 [1]000
 [3]000
 [2]000
--------------
 [12]000 - correction(2) = factor(10)
Remark: This also means the key is never a fixed length

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 = 33


Source: https://gist.github.com/TheBarret/644cac...54366da41c

Perhaps useless to some, maybe useful for others, that i leave up to you.
Why a function for the random instance when you instantiate it as static anyways inside the method? Why not declare it a scope higher and set it in the constructor?
Static rnd As New Random(Environment.TickCount)


ew
(Jan 5, 2018 11:20 AM)debug Wrote:  Static rnd As New Random(Environment.TickCount)


ew

Aww he still butt hurt we kicked and banned his ass out. how cute ^^ you can eww all you want, i know im right and thats all there is to it.
Definitely a cool project. I dont really understand the hate :)
[Image: giphy-2-1.gif]

(Jan 5, 2018 02:01 PM)weld Wrote:  Definitely a cool project. I dont really understand the hate :)

They are butt hurt coz i banned them both of my discord where all the cool programmer guys hang out ^^
(Jan 5, 2018 02:27 PM)Barret Wrote:  They are butt hurt coz i banned them both of my discord where all the cool programmer guys hang out ^^

How does being "butt hurt" invalidate my point? I really couldn't care less about being in the Discord.
(Jan 5, 2018 05:16 PM)Ninja Wrote:  How does being "butt hurt" invalidate my point? I really couldn't care less about being in the Discord.

^ I've got bigger and better things to do than join the dick sucking.
I am completely shocked. From a member of said years experience, i'm dumfounded seeing a function return only returning One value regardless of anything.

I closed VS down within an instant seeing this.

Code
    Public Shared Function Validate(key As String) As Boolean
' what ever here
        Return False
    End Function

Have you suddenly forgot what a function is? a sub!!!! mate :/
(Jan 6, 2018 09:03 PM)debug Wrote:  ^ I've got bigger and better things to do than join the dick sucking.

Amen brother.
(Jan 7, 2018 03:38 PM)Sn0wX Wrote:  I am completely shocked. From a member of said years experience, i'm dumfounded seeing a function return only returning One value regardless of anything.

I closed VS down within an instant seeing this.

Code
    Public Shared Function Validate(key As String) As Boolean
' what ever here
        Return False
    End Function

Have you suddenly forgot what a function is? a sub!!!! mate :/

You can't act like you haven't done this before... You have an idea for a method, but you're working on something else, so you just define it with the intent to come back to it later.
(Jan 7, 2018 09:50 PM)Hawk HF Wrote:  You can't act like you haven't done this before... You have an idea for a method, but you're working on something else, so you just define it with the intent to come back to it later.

And that 'later' should be before releasing it.
(Jan 7, 2018 10:03 PM)Ninja Wrote:  And that 'later' should be before releasing it.

Meh, it's a project labeled [Just For Fun].
(Jan 8, 2018 05:36 AM)Hawk HF Wrote:  Meh, it's a project labeled [Just For Fun].

Still, bad practices should be avoided. I can't sleep if I release code that I know contains flaws.
(Jan 8, 2018 09:04 AM)Ninja Wrote:  Still, bad practices should be avoided. I can't sleep if I release code that I know contains flaws.

4+ years without sleeping? That must be tough.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by BarretFeb 10, 2018 10:05 PM 6 457 Feb 10, 2018 10:05 PM
Last Post: VmX5
[.NET] by BarretFeb 4, 2018 03:05 PM 2 306 Feb 4, 2018 03:05 PM
Last Post: Barret
[Python] by Loopy For YouJan 16, 2018 10:25 PM 0 139 Jan 16, 2018 10:25 PM
Last Post: Loopy For You