Skip to content
PHP Logo

Are there any freeware encryption programs that can be controlled via exec() and do not require installation?

One possible solution to this issue is to use the OpenSSL extension in PHP to perform encryption. This extension allows for encryption and decryption using various algorithms such as AES. By using the OpenSSL functions in PHP, we can achieve encryption without the need for external software or installation.

php
$data = "Hello, world!";
$key = "my_secret_key";

$encrypted = openssl_encrypt($data, 'AES-128-CBC', $key, 0, '1234567890123456');
echo "Encrypted: " . $encrypted . "\n";

$decrypted = openssl_decrypt($encrypted, 'AES-128-CBC', $key, 0, '1234567890123456');
echo "Decrypted: " . $decrypted . "\n";