Originally published at: http://www.sitepoint.com/encrypt-large-messages-asymmetric-keys-phpseclib/
This tutorial will show you how to encrypt arbitrarily large messages with asymmetric keys and a PHP library called phpseclib.
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.