I need to encrypt files at one computer and open it another one using PHP without external libraries. The code should work at both PHP4 and PHP5.
Encryption function makes str_split of the string and encodes each character (ord) using str_split of password. Then it makes chr and I get binary data. This binary data is encoded using base64_encode and I get ascii string.
I transfer this file to another computer who knows the password. I make base64_decode and make decrypt.
The problem appeares sometimes because the first computer has ASCII default_charset and second has UTF-8. That's why nth-char $temproraryBinaryString[$n-1] may have different values at these computers.
Can I ask PHP to treat all strings as ASCII if I cannot control php.ini at any of this computers?