Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Algorithm


  • Please log in to reply
4 replies to this topic

#1 acidman

acidman

    Universalist

  • Banned (NOT IN USE)
  • 266 posts

Posted 17 February 2013 - 03:31 AM

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>
My dream is to have a dream...







#2 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 5,839 posts

Posted 17 February 2013 - 04:09 AM

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! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. 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


#3 acidman

acidman

    Universalist

  • Banned (NOT IN USE)
  • 266 posts

Posted 17 February 2013 - 04:38 AM

I can't post any code becuase I don't have any code, my question is basically how do I go about writing an algorithm can someone point me in the right direction?
My dream is to have a dream...

#4 acidman

acidman

    Universalist

  • Banned (NOT IN USE)
  • 266 posts

Posted 17 February 2013 - 05:03 AM

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


AutoIt         
#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.
My dream is to have a dream...

#5 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 5,839 posts

Posted 17 February 2013 - 05:48 AM

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, 17 February 2013 - 05:51 AM.

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. 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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users