From this value to the private key we deduce how strong the private key which composed of 904 bytes 2048 bits as shown. The algorithm will encrypt the user's passwords by the public key while the private key will be used for decryption purposes using the following code for encryption public function RSA_encrypt data if openssl_public_encrypt data, encrypted this pubkey data base64_encode encrypted else throw new Exception Unable to encrypt data. Perhaps it is bigger than the key size return data In other hand the following codes used for decryption public function RSA_decrypt data if openssl_private_decrypt base64_decode data decrypted this privkey data decrypted else data return data Where openssl_public_encrypt function is used inside RSA_encrypt data function to encrypt data with public key and stores the result into encrypted variable. As well as openssl_private_decrypt function used inside RSA_decrypt data function to decrypt data with private key and stores the result into the decrypted variable. First after the creation of both public and private keys and prepare them using setkey val function. This is followed by compression of the data to be sent in encrypted form which in our case are the passwords for users using the following piece of codes, plaintext, gzcompress plaintext. Then a created system gets the public key of the recipient using a command publicKey, openssl_pkey_get_public public key. Generate the public key for the private key using a command a_key openssl_pkey_get_details publicKey.