Jump to content

Algorithm


acidman
 Share

Recommended Posts

I just want to make sure about writing my own algorith, becuase I've made a udf that will generate a key, write it to the the registry and then I want to encrypt the same value and store it in some file. But when the key from the registry is read and the key from the file is decrypted and then validated through using arithmetic comparisons they should be a math.

This is how I get it from the research I've done

Key generated -->> 1010101242424

Key from above encrypted through calculations

E.g 1 = 4Abd and 0 = 6jabd then when the key is decrypted the encrypted key should be returned as the same value before encryption>

[u]My dream is to have a dream...[/u]

Link to comment
Share on other sites

I think you meant to say 'match' instead of 'math' at the end?

It's probably more appropriate that you supply some code too, and post in the General Help & Support forum here, than here in Chat, which is for non-AutoIt stuff generally ... at least coding wise.

Not quite understanding what you are asking either, though I think I get the general drift, and what you say is certainly feasible and I have done similar many times myself, but is it the feasibility or the code you are after?

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Ok here's what I have, it's still in a very rough shape but this is why I need to have my own algorithm, otherwise a program

can easily be cracked, I am trying to think out of the box

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.9.0 (beta)
Author: ac1dm4n



#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

Func _Generatekey($Level, $SoftwareName)
If $Level = 1 Then
$GenRand = Random(1, 45, 2)
$rs = StringReplace($GenRand, ".","THUYZ" )
$rs1 = StringReplace($rs, "5", "XQPHT", 1)
$rs2 = StringReplace($rs1, "1", "OP4HG", 2)
RegWrite("HKEY_CURRENT_USER\Software\Thekeymaker" & "\" & $SoftwareName, "\Key", "REG_SZ", $rs2)
Local $Stb = StringtoBinary($rs2, 1)
Iniwrite(@WindowsDir & "\Vkey.ini", $SoftwareName, "Vkey", $Stb)
Endif
If $level = 2 Then
$GenRand = Random(1, 90, 2)
$rs = StringReplace($GenRand, ".","HTPQU" )
$rs1 = StringReplace($rs, "5", "DVIXZ", 1)
$rs2 = StringReplace($rs1, "1", "REZZQ", 2)
$rs3 = StringReplace($rs2, "1", "TGHRE", 3)
RegWrite("HKEY_CURRENT_USER\Software\Thekeymaker" & "\" & $SoftwareName, "\Key", "REG_SZ", $rs3)
Iniwrite(@WindowsDir & "\Vkey.ini", $SoftwareName, "Vkey", $Stb)
Local $Stb = StringtoBinary($rs3, 1)
Iniwrite(@WindowsDir & "\Vkey.ini", $SoftwareName, "Vkey", $Stb)
EndIf

If $level = 2 Then
$GenRand = Random(1, 90, 2)
$rs = StringReplace($GenRand, ".","HTPQU" )
$rs1 = StringReplace($rs, "5", "DVIXZ", 1)
$rs2 = StringReplace($rs1, "1", "REZZQ", 2)
$rs3 = StringReplace($rs2, "1", "TGHRE", 3)
$rs4 = StringReplace($rs3, "1", "LMTOP", 4)
RegWrite("HKEY_CURRENT_USER\Software\Thekeymaker" & "\" & $SoftwareName, "Key", "REG_SZ", $rs4)
Local $Stb = StringtoBinary($rs4, 1)
Iniwrite(@WindowsDir & "\Vkey.ini", $SoftwareName, "Vkey", $Stb)
EndIf

EndFunc


Func _Validatekey($SoftwareName)
$regread = regread("HKEY_CURRENT_USER\Software\Thekeymaker\" & $SoftwareName, "Key")
$iniread = IniRead(@WindowsDir & "\Vkey.ini", $SoftwareName, "Vkey", 0)
BinaryToString($iniread, 1)
$Eval = StringCompare($regread, $iniread)
If $Eval = True Then
Else
Exit
Endif


EndFunc

Ok so this is what I have figured out so far. nothing is concrete yet I still have some work to do, I just believe an algorithm

will be the best way of generating a key, so I just needed to be pointed in the right direction. The plan here is when someone buys an app from a developer a key has to be generated for the user and then it must be sent to the developer.

Then the key obtained from the user must be scrambled or encrypted and then it must be given back to the user

and then when the key evaluation takes place the app must compare the two strings and according to that will the app

be activated.

[u]My dream is to have a dream...[/u]

Link to comment
Share on other sites

Did you miss the bit where I said - General Help & Support?

The Chat section is where we get to escape from coding for a while.

You should ask a Mod to move this topic there.

Where I'm sure you'll get far more help, being in the right place.

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...