This tutorial will show you how to encrypt arbitrarily large messages with asymmetric keys and a PHP library called phpseclib.
Introduction
Most of us understand the need to encrypt sensitive data before transmitting it. Encryption is the process of translating plaintext (i.e. normal data) into ciphertext (i.e. secret data). During encryption, plaintext information is translated to ciphertext using a key and an algorithm. To read the data, the ciphertext must be decrypted (i.e. translated back to plaintext) using a key and an algorithm.
What does it mean on test.php file when you print $plaintext beofre and after it seems blackmail to reader. It is failed to decrypt original text because when I print $plaintext2 I got a garbage output like cipher text.
However, please correct and run yourself then edit code again.
I found the same problem. The code in github is buggy, and different to what’s in the article. The functions in the text of the article above have the bugs fixed. So, use those instead.