Question

I'm using a CRM software called vTiger which uses the function openssl_encrypt. Unfortunately my hosting (Hostgator) doesn't support it on php 5.2.17. They do support it on php 5.3, but I can't use it as vTiger has a lot of deprecated functions. That was a bit of background so you know where the question is coming from, now the question:

It is possible to replace openssl_encrypt by other function? how could I do that

Thanks in advance. If that's not possible, please let me know.

Was it helpful?

Solution

In addition to mcrypt you could use phpseclib, a pure PHP AES implementation. eg

<?php
include('Crypt/AES.php');

$cipher = new Crypt_AES(CRYPT_AES_MODE_ECB);
$cipher->setKey('abcdefghijklmnopijklmnop');

$size = 10 * 1024;
$plaintext = str_repeat('a', $size);

echo $cipher->decrypt($cipher->encrypt($plaintext));
?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top