Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using libsodium in php on cPanel shared hosting?

I'm not an expert PHP developer, but I'm trying to use libsodium on Godaddy; however, the calls and constants seem to be undefined despite it showing up on phpinfo and me having previously enabled the module via PHP version.


Here's an example that doesn't work (bascially from libsodium's documentation):


var_dump(phpversion('libsodium')); // shows 1.0.7

// Generating your encryption key
echo $key."<br>";

// Using your key to encrypt information
echo $nonce."<br>";

$ciphertext = sodium_crypto_secretbox('test', $nonce, $key);
echo $ciphertext."<br>";