Search the Community
Showing results for tags 'aes'.
-
Hello again to all, I've searched many times in forum and help file to find AES-256-GCM Algorithm for Crypt\Decrypt strings and files but i did not find anything about GCM Algorithm. Do you have any idea for solving this issue?
-
Hi I'm trying to replicate a php function that I need: function cripta($data){ return openssl_encrypt($data,'AES-128-CBC',base64_decode("dGVzdHBhc3N3b3JkLi4uLg=="),0,"0102030405060708"); } which is basically a base64encode of an aes encryption. I found some helpful UDF here which has both BASE64.au3 and AES.au3 I tried to write the "cripta" function: #Include "AES.au3" #include "BASE64.au3" Global $mainKey = "dGVzdHBhc3N3b3JkLi4uLg==" Global $mainIV = "0102030405060708" _AES_Startup() ConsoleWrite(cripta("test") & @CRLF) Func cripta($Data) Global $mainKey, $mainIV $Key = _Base64Decode($mainKey) Return BinaryToString(_Base64Encode(_AesEncrypt($Key, $Data, $AES_CBC_MODE, $mainIV))) EndFunc But when I try to execute in php I get: echo cripta('test'); // OUTPUT: CB5j5NHA9vQibaGgmvnNTA== And when I try in execute in autoit: ConsoleWrite(cripta("test") & @CRLF) ;OUTPUT: MDEwMjAzMDQwNTA2MDcwOOSAx7xqqmIcIU5UI4ZDItw= Why are those so different? Can someone please help me, thank you
-
You're going to need Beege's Base64 UDF and Ward's AES UDF. Beege's Base64 UDF - Base64.au3 Original Thread: https://goo.gl/H1QqEG Ward's AES UDF - AES.au3 Original Thread: https://goo.gl/zQdASR Ward's UDF is amazing, but I felt the need to make a few "Helper" functions to make things easier. _Encrypt() and _Decrypt(), accepting 1 parameter and using a randomly generated IV for encryption, making the end encryption string dynamic and never the same. It pulls the IV from the first 16 characters of an encrypted string for the _Decrypt() routine. EncryptionExample.au3 Now for the PHP goodies! First, we have a required include Encryption.php which was compiled by me. And, finally, an example of the PHP side of things. EncryptionExample.php /EncryptionExample.php?Action=Decrypt&Text=W4NAKRzuuTOfl9pAE8kSUgMYcuosvbUy58GR9w46U8w= Should output something like this: