|
Post by Roger Cabo on Jun 30, 2023 18:31:32 GMT 1
Hi everyone,
currently I must work at the "gb32 send files to a VServer and back" problem. I must crypt the data in gb32 and unCrypt in PHP 8.1 on the server.
Anyone have an idea how to do without poking into the memory? Because PHP can't peek and poke. :-)
|
|
|
Post by (X) on Jun 30, 2023 21:11:25 GMT 1
Here is an example of how you can read a data file byte by byte in PHP:
$filename = 'data.txt'; $handle = fopen($filename, 'rb'); if ($handle) { while (!feof($handle)) { $byte = fread($handle, 1); // Process the byte here } fclose($handle); }
|
|
|
Post by (X) on Jun 30, 2023 21:13:34 GMT 1
To process the data file byte by byte...
$inFilename = 'data.txt'; $outFilename = 'out.txt';
$inHandle = fopen($inFilename, 'rb'); $outHandle = fopen($outFilename, 'wb');
if ($inHandle && $outHandle) { while (!feof($inHandle)) { $byte = fread($inHandle, 1); // Process the byte here $newByte = $byte; // Replace this with your processing code fwrite($outHandle, $newByte); } fclose($inHandle); fclose($outHandle); }
|
|
|
Post by Roger Cabo on Jul 1, 2023 19:37:32 GMT 1
I have wrote a new encryption that use some AES/RSA parts. Extremely impressive what gpt came along if you force it. The encryption result in different data and length anyway you input the same source again and again.
a) 34¬Ê݃ÍsØÚ!ÑÓ×ÝŒ¶ueª°Ãq•Åºl²¯ªi±Y¢œ¢—›¯®¯ª]¦Ñ0 b) ‹ÎžCu¸Ëu¿lƧÈq³±µ¿ŽÐÍü§ðîªô9åéìñ~Aìíâì›äz'†
It's usable with PHP as well. Now its possible to encrypt in GB32 and decrypt on the VServer.
|
|