Jump to content

Str2Chr & Chr2Str


themax90
 Share

Recommended Posts

Well, as we ALL may know(if we don't go experient with it) that StringEncrypt is rather slow, especially with high string lengths. Hex, is easily crackable if you know enough. So I made a weak encryption method to change a String into Chr numbers using Asc.

Number of Chr's & Chr's & ex cetera.

For example: 265 --> 2 Chars in Expression --> 65 --> Chr(65) = Uppercase A

265266267 = ABC

Example :

$Str = Str2Chr("Hello 123 !@#")
MsgBox(0, Chr2Str($Str), $Str)oÝ÷ Ù8^Ë
+¦èºÖ¬}«-jÄ­®)àNÞÅ©ÝìS¡+kxºÙË
+ö¬µêî׫(!²Úâ ^a°7v­'ڲ׫¶§JÚâ'r¼©´w«yªÞ¶ºw-ìjëh×6Func Str2Chr(Const $String)
    Local $Array = StringSplit($String, "")
    Local $BuffStr = ""
    Local $Str = ""
    Local $Track = 1
    For $Track = 1 to $Array[0] Step 1
        $BuffStr = Asc($Array[$Track])
        $Str = $Str & StringLen($BuffStr) & $BuffStr
    Next
    Return $Str
EndFunc
Func Chr2Str(Const $String)
    Local $Start = 1
    Local $Str = ""
    Local $StrLenGo
    While $Start <= StringLen($String)
        $StrLenGo = StringRight(StringLeft($String, $Start), 1)
        $Str = $Str & Chr(StringRight(StringLeft($String, $Start + $StrLenGo ) , $StrLenGo))
        $Start = $Start + StringRight(StringLeft($String, $Start), 1) + 1
    WEnd
    Return $Str
EndFunc

Hope someone finds this useful.

Link to comment
Share on other sites

  • Moderators

Comparing this to _StringEncrypt() is like comparing a Fiat to a Mercedes. You might want to re-look over why _StringEncrypt takes a while and everything it does.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

It's just basic encryption. Also may be a way to write packets in the future for my developement. It is way to slow for networking. I understand it does alot, but this is an alternative while not really safe, is a little bit safer then hex.

EnCodeIt is basic obfuscation and is like the Fiat of obfuscating.

If we really must be technical about it. No offense, but I offering another way, hopefully you can see that.

Link to comment
Share on other sites

  • Moderators

But what the hell did I compare EnCodeIt to? You litterally compared it to _StringEncrypt() on processing speeds. You really need to be on zanex or something man, you wear a chip on your shoulder quite often.... No offense.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

There is no chip on my shoulder dude. I am offering another way of encryption, while weak it is. Just like you offered a form of obfuscation.

You assume to much. I'm just giving an idea. It is much faster, and if you want the string obscured then it works.

But what the hell...

I'm raising an opinion that you are more angry then me, for I feel no anger towards you.

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...