Hello I have been trying to make simple encryption with AES128 between app in C# and PHP, and it worked well quite well yesterday. I got like max 10% unencrypted data but now I got a maybe 90% unencrypted/unencoded/incomplete data. I am sure its because of the "special" charactes in these strings. I am sure it breaks the string into more strings and then it reads just part of it for example this
"/" or "+"
seems to break it every time and I cant remove these characters because it will break everything. I have tried something like this
$test = base64_decode(addslashes($StringEncodedBase64));
in hopes that it will hold the string together but I think it didnt help much if at all. I think only improvement was yesterday when I had The string encoded with base64 maybe 3-4 times atleast basically every step ended with base64 encode so i would get a nice hash in the end. But I dont want that because its nonsense performance wise pretty much and there is still some % data lost and more importantly I think it was because I used a weak key. Maybe yesterday when I was testing it I had better success ratio because I had very simple key like
1234567890123456
I have changed the key and the new is more complicated like
Omb1AH02AsuUACfu
is it why it produces these complicated broken strings? For IV I use random strings without numbers like
IHZWGhoxZoIugQmY
In the end of this logfile is one luckily decrypted message. On the lines above are the other 90%. I also thought about converting the these special characters into byte[] but the mcrypt_decrypt want a string and I also need it to return me a string after all. Thanks for any input
[08-Jun-2016 10:30:44 Europe/Moscow] Encoded base64:
[08-Jun-2016 10:30:44 Europe/Moscow] NbqJie6PRQQtTMOzVFFCam4JcrheQQVvcS5kL5T7rBJqMcIZlqrZ8ZCip7vFqSX2g3c6Vf2KuG/ AQIWl9aDcNQFxFAfD5 C7reP8TttQK8GSp9S5A2VoJysxuyZOr2QpBZZIw07Kvfc2vilm ukqQebbEqxeQKeWlAX MjTnI=
[08-Jun-2016 10:30:44 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:30:44 Europe/Moscow] Decoded base64:
[08-Jun-2016 10:30:44 Europe/Moscow] 5ş‰‰îŹE-LĂłTQBjn r¸^Aoq.d/”ű¬j1–ŞŮń˘§»Ĺ©%öw:UýЏoŔ@…Ąő Ü5qĂä.ëx˙¶Ô
đd©ő.@ŮZ ĘĚnÉ“«Ů
Ae’0Ó˛Ż}ÍŻŠY®’¤m±*Ĺä
yi@\ČÓś
[08-Jun-2016 10:30:44 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:30:44 Europe/Moscow] Decrypt AES128:
[08-Jun-2016 10:30:44 Europe/Moscow] W;
[08-Jun-2016 10:30:44 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:30:51 Europe/Moscow] Encoded base64:
[08-Jun-2016 10:30:51 Europe/Moscow] bLExr70FXbpbNqbws1kGNqdFAWY/2E4FJaytw7FYBNQlaz5610QcW17B3I2 x7gYMxz4ZM6RVWxZOYaUyDrtUJsFgER0zDP5F/RPhcL1tRrVbv4bPdYmkoOQ8ZunHkJmfHbLocoMhzA286o acEABsV/ITe8v7qbWD9JxOiPfCY=
[08-Jun-2016 10:30:51 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:30:51 Europe/Moscow] Decoded base64:
[08-Jun-2016 10:30:51 Europe/Moscow]
[08-Jun-2016 10:30:51 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:30:51 Europe/Moscow] Decrypt AES128:
[08-Jun-2016 10:30:51 Europe/Moscow]
[08-Jun-2016 10:30:51 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:30:57 Europe/Moscow] Encoded base64:
[08-Jun-2016 10:30:57 Europe/Moscow] IzLBNSV5/xFuoezSFjrM4cIvz/m4woTUabL/qiR/7mk1LZyJyWmtgNjsp2fjvXOxC57sFGFiXPtHMWNiHSV23inmlI 7SqT9TnA/UiVxY5Gta7QVIzHBqpfl2jHBSf1yFcMLLq0DTinT6ZQ/gb9AOmo3PiaPQeSYcKHg3X7cAe4=
[08-Jun-2016 10:30:57 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:30:57 Europe/Moscow] Decoded base64:
[08-Jun-2016 10:30:57 Europe/Moscow] #2Á5%y˙nˇěŇ:ĚáÂ/Ďů¸Â„Ôi˛˙Ş$îi5-ś‰Éi€Řě§gă˝s±žěab\űG1cb%vŢ)攎ҩ?SśÔ‰\XäkZíHĚpjĄůvŚpR\…pÂË«@ÓŠtúeŕoĐšŤĎ‰ŁĐy&(x7_·
[08-Jun-2016 10:30:57 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:30:57 Europe/Moscow] Decrypt AES128:
[08-Jun-2016 10:30:57 Europe/Moscow] I Would really like to get all my data
[08-Jun-2016 10:30:57 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:31:04 Europe/Moscow] Encoded base64:
[08-Jun-2016 10:31:04 Europe/Moscow] In0p0Wjo5wjAkBGYa1/cCUA7YVHrePSJR983WPMO8xRAfpYUrixWDcDXvBcN0D34M1rLgG8fJxSUJhQ72NSqX4w78W62PBbqxR9B1I/qCZmICGsbxyK0i0Fl/uV1EOtl1RS7nckfDVytW2tfPDUk5wzvc RGxjUOna/jliKRH1A=
[08-Jun-2016 10:31:04 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:31:04 Europe/Moscow] Decoded base64:
[08-Jun-2016 10:31:04 Europe/Moscow] "})ŃhčçŔk_Ü @;aQëxô‰Gß7Xóó@~–®,V
Ŕ׼
Đ=ř3ZË€o'”&;ŘÔŞ_Ś;ńn¶<ęĹAÔŹę ™kÇ"´‹AeţĺuëeŐ»ťÉ
\[k_<5$çďq±ŤC§křĺ¤GÔ
[08-Jun-2016 10:31:04 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:31:04 Europe/Moscow] Decrypt AES128:
[08-Jun-2016 10:31:04 Europe/Moscow] I Would really like to get
[08-Jun-2016 10:31:04 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:31:11 Europe/Moscow] Encoded base64:
[08-Jun-2016 10:31:11 Europe/Moscow] OCPovKfyxdxpLxHed6twwJtKUTEhHVQ0cnJqrLs5yufLt9Mejn3zXanYkvDnNmbQJdFfCwSokRneAkrVKKmJJaFWhH/d2vfy6dC5FhKUNyS3SO2COMG9rHaunJG/SUNMaN9Le31KnVGgrxE cnnTPoC2EvUiFCe7umeW4AgydE0=
[08-Jun-2016 10:31:11 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:31:11 Europe/Moscow] Decoded base64:
[08-Jun-2016 10:31:11 Europe/Moscow] 8#輧ňĹÜi/Ţw«pŔ›JQ1!T4rrj¬»9ĘçË·ÓŽ}ó]©Ř’đç6fĐ%Ń_¨‘ŢJŐ(©‰%ˇV„ÝÚ÷ňéĐą”7$·Hí‚8Á˝¬v®ś‘żICLhßK{}JťQ ŻžtĎ -„˝H… îî™ĺ¸ť
[08-Jun-2016 10:31:11 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:31:11 Europe/Moscow] Decrypt AES128:
[08-Jun-2016 10:31:11 Europe/Moscow]
[08-Jun-2016 10:31:11 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:31:17 Europe/Moscow] Encoded base64:
[08-Jun-2016 10:31:17 Europe/Moscow] KG91J7FhmzaNTrtJvRScQv9ogBtGmdMZO8vZAFj9pAdlQ5NQf9M0WE0g3ZBb2SnV91WanLt1DePmx64vnKRqeHA2c4ty92L00REVpAj5apO4Z9aDQDIhh23AyPQ3ojsoZE6ckDcSaNprERyK4SjKYBTazlwKHPKMc7ZgrnB4qnM=
[08-Jun-2016 10:31:17 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:31:17 Europe/Moscow] Decoded base64:
[08-Jun-2016 10:31:17 Europe/Moscow] (ou'±a›6ŤN»I˝śB˙h€F™Ó;ËŮ
[08-Jun-2016 10:31:17 Europe/Moscow] ----------------------------------------------------------
[08-Jun-2016 10:31:17 Europe/Moscow] Decrypt AES128:
[08-Jun-2016 10:31:17 Europe/Moscow] I Would really like to get all my data out :) D6BAB3086E9CA53E5848A4006C8F2610 1465371072
[08-Jun-2016 10:31:17 Europe/Moscow] ----------------------------------------------------------