You need to sign in to do that
Don't have an account?

Encrypting a String to send in a URL
I have a string with Parameters and their values that i need to send in a URL to a website.
How can I encrypt it where the other party writing in PHP can decrypt it?
How can I encrypt it where the other party writing in PHP can decrypt it?
Try this code,
// Generate an AES key for the purpose of this sample.
// Normally this key should be stored in a protected custom setting
// or an encrypted field on a custom object
Blob cryptoKey = Crypto.generateAesKey(256);
// Generate the data to be encrypted.
Blob data = Blob.valueOf('Test data to encrypted');
// Encrypt the data and have Salesforce.com generate the initialization vector
Blob encryptedData = Crypto.encryptWithManagedIV('AES256', cryptoKey, data);
For more INFO go through below link,
https://developer.salesforce.com/page/Apex_Crypto_Class
I hope this sloves your problem.
Thanks
Nitin
How can he decrypt it ?
Here is the blog for your php developer.
http://wpy.me/blog/15-encrypt-and-decrypt-data-in-php-using-aes-256
Thanks
Nitin