JustinReno Posted December 28, 2007 Share Posted December 28, 2007 (edited) This program was made to encode/decode messages. Using 1-26 as a-z. The only punctuation mark it supports is a period.Decoder By: CRZFTXEncoder By : AslaniThis is unfinishedHere is the code:expandcollapse popup$GUI = GUICreate("Secret Message", 314, 394) GUICtrlCreateTab(0, 0, 313, 393) GUICtrlCreateTabItem("Encode") GUICtrlCreateLabel("Message to Encode:", 8, 24, 102, 17) $MessagetoEncode = GUICtrlCreateEdit("", 9, 40, 295, 129) GUICtrlCreateLabel("Encoded Message:", 8, 208, 96, 17) $EncodedMessage = GUICtrlCreateEdit("", 8, 224, 297, 129) $Encode = GUICtrlCreateButton("Encode", 8, 176, 299, 25, 0) $CopytoClipboard1 = GUICtrlCreateButton("Copy to Clipboard", 8, 360, 299, 25, 0) GUICtrlCreateTabItem("Decode") GUICtrlCreateLabel("Message to Decode:", 8, 24, 103, 17) $MessagetoDecode = GUICtrlCreateEdit("", 8, 40, 295, 129) $Decode = GUICtrlCreateButton("Decode", 8, 176, 299, 25, 0) GUICtrlCreateLabel("Decoded Message:", 8, 208, 97, 17) $DecodedMessage = GUICtrlCreateEdit("", 8, 224, 295, 129) $CopytoClipboard2 = GUICtrlCreateButton("Copy to Clipboard", 8, 360, 299, 25, 0) GUICtrlCreateTabItem("About") GUICtrlCreateLabel("Created By:", 112, 32, 59, 17) GUICtrlCreateLabel("Justin Reno", 56, 48, 183, 41) GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) GUICtrlCreateLabel("Secret Message copyright Justin Reno 2007.", 48, 88, 216, 17) $FirstLink = GUICtrlCreateLabel("www.AutoItScript.com", 48, 120, 187, 28) GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000FF) $SecondLink = GUICtrlCreateLabel("www.JustinReno.tk", 64, 144, 163, 28) GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateLabel("Have Fun!", 104, 184, 77, 24) GUICtrlSetFont(-1, 12, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF0000) GUICtrlCreateLabel("Contact: JustinReno@JustinReno.tk", 8, 360, 302, 28) GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x008080) GUICtrlCreateLabel("This program was created in the wonderfull scripting", 24, 216, 248, 17) GUICtrlSetColor(-1, 0x800000) GUICtrlCreateLabel("language named AutoIt.", 88, 232, 117, 17) GUICtrlSetColor(-1, 0x800000) $Pic = GUICtrlCreatePic(@TempDir&"\AutoIt.jpg", 88, 256, 116, 100) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case -3 Exit Case $Encode _Encode(GUICtrlRead($MessagetoEncode)) Case $CopytoClipboard1 ClipPut(GUICtrlRead($EncodedMessage)) Case $Decode _Decode(GUICtrlRead($MessagetoDecode)) Case $CopytoClipboard2 ClipPut(GUICtrlRead($DecodedMessage)) Case $FirstLink ShellExecute("www.AutoItScript.com") Case $SecondLink ShellExecute("www.JustinReno.tk") EndSwitch WEnd Func _Encode($Message) $Input = StringLower($Message) $Output = "" While StringLen($Input) > 0 Select Case StringLeft($Input ,1) = " " $Output &= " " $Input = StringTrimLeft($Input, 1) Case StringLeft($Input, 1) = "." $Output &= "." $Input = StringTrimLeft($Input, 1) Case StringLeft($Input, 2) <> StringLeft($Input, 1) & " " $Output &= Asc(StringLeft($Input, 1))-96 & "|" $Input = StringTrimLeft($Input, 1) Case StringLeft($Input, 1) $Output &= Asc(StringLeft($Input, 1))-96 $Input = StringTrimLeft($Input, 1) EndSelect WEnd $Output = StringTrimRight($Output, 1) GUICtrlSetData($EncodedMessage, $Output) $Message = "" EndFunc Func _Decode($Message) $Output = "" While StringLen($Message) > 0 Select Case StringLeft($Message, 1) = " " $Output &= " " $Message = StringTrimLeft($Message, 1) Case StringLeft($Message, 1) = "." $Output &= "." $Message = StringTrimLeft($Message, 1) Case Number(StringLeft($Message, 2)) <> Number(StringLeft($Message, 1)) $Output &= Chr(96+Number(StringLeft($Message, 2))) $Message = StringTrimLeft($Message, 2) Case Number(StringLeft($Message, 1)) $Output &= Chr(96+Number(StringLeft($Message, 1))) $Message = StringTrimLeft($Message, 1) Case StringLeft($Message, 1) = "|" $Message = StringTrimLeft($Message, 1) EndSelect WEnd GUICtrlSetData($DecodedMessage, $Message) EndFuncHave Fun. Edited December 28, 2007 by JustinReno Link to comment Share on other sites More sharing options...
Achilles Posted December 28, 2007 Share Posted December 28, 2007 I'm confused... Is this code supposed to be even slightly difficult? "abcd" is encoded as "1234"... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
JustinReno Posted December 28, 2007 Author Share Posted December 28, 2007 (edited) I know. Its not meant to be the hardest code in the world to crack. And, abcd is not 1234 its 1|2|3|4. Edited December 28, 2007 by JustinReno Link to comment Share on other sites More sharing options...
weaponx Posted December 28, 2007 Share Posted December 28, 2007 Not happy with _StringEncrypt()? Link to comment Share on other sites More sharing options...
JustinReno Posted December 28, 2007 Author Share Posted December 28, 2007 I am, but this is a simpler code. Link to comment Share on other sites More sharing options...
HeffeD Posted December 28, 2007 Share Posted December 28, 2007 You ought to take a look at ROT13. (The alphabet is shifted 13 letters. A = N) Still not a difficult system to decrypt, but at least it's a bit trickier than a straight A = 1 system. Shouldn't be too difficult to code either. Link to comment Share on other sites More sharing options...
Wus Posted December 28, 2007 Share Posted December 28, 2007 (edited) Try coding up affine and hill ciphers too. They are classics.http://en.wikipedia.org/wiki/Affine_cipherhttp://en.wikipedia.org/wiki/Hill_cipherI've never done much with the Hill cipher, but I know the affine cipher is pretty easy to do essentially pick and a and b such that 1<=a<=25, 0<=b<=25 where GCD(a,m)=1 then its just Encrypted = MOD(a*PlainText+b, 26) and the decryption requires you to find an inverse, but thats pretty easy to do (mod 26). Edited December 28, 2007 by Wus Link to comment Share on other sites More sharing options...
JustinReno Posted December 28, 2007 Author Share Posted December 28, 2007 What are they? I'll look them up. Link to comment Share on other sites More sharing options...
GEOSoft Posted December 28, 2007 Share Posted December 28, 2007 Not happy with _StringEncrypt()?Actually I just spotted a problem with _StringEncrypt(0 yesterday but I have not had time to put a demo script together yet. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
JustinReno Posted December 28, 2007 Author Share Posted December 28, 2007 What was the problem? Link to comment Share on other sites More sharing options...
GEOSoft Posted December 28, 2007 Share Posted December 28, 2007 What was the problem?I'll post an example when I get a chance but it had to do with using _StringEncrypt(0 on an empty string. I was doing it from an IniRead(). I THINK this will probably show it but I'll check later$a = _StringEncrypt(0, "", "trythis")MsgBox(0, "TEST", $a)I'm still going to have a problem using _StringEncrypt to do what I want anyway but I'll get into that later. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
JustinReno Posted December 28, 2007 Author Share Posted December 28, 2007 I don't think its a bug/problem. It can't encrypt an empty string. Link to comment Share on other sites More sharing options...
GEOSoft Posted December 28, 2007 Share Posted December 28, 2007 I don't think its a bug/problem. It can't encrypt an empty string.That was the problem. "_StringEncrypt(0" means decrypt and it was decrypting an empty string, in other words there was a return in the message box. As soon as I get time I'll pull the script and post part of it in Help. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
crzftx Posted December 28, 2007 Share Posted December 28, 2007 I vaguely remember doing that... thanks for the credit! even on such a simple script. Link to comment Share on other sites More sharing options...
therks Posted December 29, 2007 Share Posted December 29, 2007 Func enc($string) $bin = StringToBinary($string) $bin = StringTrimLeft($bin, 2) $sl = StringLen($bin) $newbin = '' for $i = 1 to $sl step 2 $chunk = '0x' & StringMid($bin, $i, 2) $inv = Hex(BitXOR($chunk, 0xFF), 2) $newbin &= $inv next Return BinaryToString('0x' & $newbin) EndFunc Just whipped this one up myself. I'm sure it'd be easy enough to "crack", but for simple purposes... ¶ßßßßÏÏßßßßßØßßÞ My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
zxzxzx Posted December 29, 2007 Share Posted December 29, 2007 This program was made to encode/decode messages. Using 1-26 as a-z. The only punctuation mark it supports is a period. Decoder By: CRZFTX Encoder By : Aslani This is unfinished Here is the code: expandcollapse popup$GUI = GUICreate("Secret Message", 314, 394) GUICtrlCreateTab(0, 0, 313, 393) GUICtrlCreateTabItem("Encode") GUICtrlCreateLabel("Message to Encode:", 8, 24, 102, 17) $MessagetoEncode = GUICtrlCreateEdit("", 9, 40, 295, 129) GUICtrlCreateLabel("Encoded Message:", 8, 208, 96, 17) $EncodedMessage = GUICtrlCreateEdit("", 8, 224, 297, 129) $Encode = GUICtrlCreateButton("Encode", 8, 176, 299, 25, 0) $CopytoClipboard1 = GUICtrlCreateButton("Copy to Clipboard", 8, 360, 299, 25, 0) GUICtrlCreateTabItem("Decode") GUICtrlCreateLabel("Message to Decode:", 8, 24, 103, 17) $MessagetoDecode = GUICtrlCreateEdit("", 8, 40, 295, 129) $Decode = GUICtrlCreateButton("Decode", 8, 176, 299, 25, 0) GUICtrlCreateLabel("Decoded Message:", 8, 208, 97, 17) $DecodedMessage = GUICtrlCreateEdit("", 8, 224, 295, 129) $CopytoClipboard2 = GUICtrlCreateButton("Copy to Clipboard", 8, 360, 299, 25, 0) GUICtrlCreateTabItem("About") GUICtrlCreateLabel("Created By:", 112, 32, 59, 17) GUICtrlCreateLabel("Justin Reno", 56, 48, 183, 41) GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000080) GUICtrlCreateLabel("Secret Message copyright Justin Reno 2007.", 48, 88, 216, 17) $FirstLink = GUICtrlCreateLabel("www.AutoItScript.com", 48, 120, 187, 28) GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000FF) $SecondLink = GUICtrlCreateLabel("www.JustinReno.tk", 64, 144, 163, 28) GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateLabel("Have Fun!", 104, 184, 77, 24) GUICtrlSetFont(-1, 12, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF0000) GUICtrlCreateLabel("Contact: JustinReno@JustinReno.tk", 8, 360, 302, 28) GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x008080) GUICtrlCreateLabel("This program was created in the wonderfull scripting", 24, 216, 248, 17) GUICtrlSetColor(-1, 0x800000) GUICtrlCreateLabel("language named AutoIt.", 88, 232, 117, 17) GUICtrlSetColor(-1, 0x800000) $Pic = GUICtrlCreatePic(@TempDir&"\AutoIt.jpg", 88, 256, 116, 100) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case -3 Exit Case $Encode _Encode(GUICtrlRead($MessagetoEncode)) Case $CopytoClipboard1 ClipPut(GUICtrlRead($EncodedMessage)) Case $Decode _Decode(GUICtrlRead($MessagetoDecode)) Case $CopytoClipboard2 ClipPut(GUICtrlRead($DecodedMessage)) Case $FirstLink ShellExecute("www.AutoItScript.com") Case $SecondLink ShellExecute("www.JustinReno.tk") EndSwitch WEnd Func _Encode($Message) $Input = StringLower($Message) $Output = "" While StringLen($Input) > 0 Select Case StringLeft($Input ,1) = " " $Output &= " " $Input = StringTrimLeft($Input, 1) Case StringLeft($Input, 1) = "." $Output &= "." $Input = StringTrimLeft($Input, 1) Case StringLeft($Input, 2) <> StringLeft($Input, 1) & " " $Output &= Asc(StringLeft($Input, 1))-96 & "|" $Input = StringTrimLeft($Input, 1) Case StringLeft($Input, 1) $Output &= Asc(StringLeft($Input, 1))-96 $Input = StringTrimLeft($Input, 1) EndSelect WEnd $Output = StringTrimRight($Output, 1) GUICtrlSetData($EncodedMessage, $Output) $Message = "" EndFunc Func _Decode($Message) $Output = "" While StringLen($Message) > 0 Select Case StringLeft($Message, 1) = " " $Output &= " " $Message = StringTrimLeft($Message, 1) Case StringLeft($Message, 1) = "." $Output &= "." $Message = StringTrimLeft($Message, 1) Case Number(StringLeft($Message, 2)) <> Number(StringLeft($Message, 1)) $Output &= Chr(96+Number(StringLeft($Message, 2))) $Message = StringTrimLeft($Message, 2) Case Number(StringLeft($Message, 1)) $Output &= Chr(96+Number(StringLeft($Message, 1))) $Message = StringTrimLeft($Message, 1) Case StringLeft($Message, 1) = "|" $Message = StringTrimLeft($Message, 1) EndSelect WEnd GUICtrlSetData($DecodedMessage, $Message) EndFunc Have Fun. oks o ive posted my code!... its not very good scripting tho.. very noobishThank Link to comment Share on other sites More sharing options...
JustinReno Posted December 29, 2007 Author Share Posted December 29, 2007 What? Link to comment Share on other sites More sharing options...
GaryFrost Posted December 29, 2007 Share Posted December 29, 2007 What?Day late and dollar short.User was notified to stop spamming, let it be. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
BigDod Posted December 29, 2007 Share Posted December 29, 2007 (edited) What?He is just spamming and has been warned. I am sure if he continues he will find himself mentioned in a very different thread.Edit - Sorry Gary, I did not see you posting. Edited December 29, 2007 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
JustinReno Posted December 29, 2007 Author Share Posted December 29, 2007 Oh, alright. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now