SoyArcano Posted April 2, 2017 Posted April 2, 2017 (edited) Hello i'm learning a little of cryptography only for educationals purporses. In my case i'm only trying to encrypt a easy string any string and then decrypt it and show it. The code is: ConsoleWrite(EnDeCrypt("What i am doing wrong","1234")) ;To ENcrypt and to DEcrypt your data. Func EnDeCrypt($plaintxt, $psw) Local $a, $b, $i, $j, $k, $cipherby, $cipher Local $tempSwap, $temp, $intLength Local $sbox[256] Local $key[256] $intLength = StringLen($psw) For $a = 0 To 255 $key[$a] = asc(Stringmid($psw, Mod($a ,$intLength)+1, 1)) $sbox[$a] = $a Next $b = 0 For $a = 0 To 255 $b = Mod(($b + $sbox[$a] + $key[$a]),256) $tempSwap = $sbox[$a] $sbox[$a] = $sbox[$b] $sbox[$b] = $tempSwap Next For $a = 1 To StringLen($plaintxt) $i = Mod(($i + 1) ,256) $j = Mod(($j + $sbox[$i]) ,256) $k = $sbox[Mod(($sbox[$i] + $sbox[$j]) , 256)] $cipherby = BitXOR(Asc(StringMid($plaintxt, $a, 1)) , $k) $cipher = $cipher & Chr($cipherby) Next Return $cipher EndFunc Never write me the encrypted and decrypted string in console., only for string nothing bad.. thx! Edited April 2, 2017 by SoyArcano
InunoTaishou Posted April 2, 2017 Posted April 2, 2017 Any reason you're trying to re-invent the wheel?
Luigi Posted April 2, 2017 Posted April 2, 2017 Exist an equivalent of this in PHP and Java? Decrypt an encrypted message from AutoIt in PHP or Java (Android Studio)? Visit my repository
Luigi Posted April 3, 2017 Posted April 3, 2017 (edited) @Inververs thank you. This is exactly what I asked, a script that encrypts in AutoIt and decrypts the message in PHP (or Java). Very usefull. Edited April 3, 2017 by Luigi Visit my repository
Luigi Posted April 3, 2017 Posted April 3, 2017 (edited) ops, wrong post... Edited April 3, 2017 by Luigi Visit my repository
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