You need to sign in to do that
Don't have an account?
Rajasekhar T
encrypted password to plain text password Using 3DES algorithm?
I have encrypted password how to decrypt using 3des algorithm? is possible encrypting/decrypting anything in Apex Code?
Any help would be greatly appreciated
Raj
Any help would be greatly appreciated
Raj
Yes, Encryption and Decryption is possible in Salesforce Using Apex Class as well. Here, I am sharing an example with you where you can encrypt your Text Character in a secure code using different algorithms Which are available in Apex Class as well.
Available algorithm Name:
1. AES128
2. AES192
3. AES256
4. hmacMD5
5. hmacSHA1
6. hmacSHA256
7. hmacSHA512
Blob exampleIv = Blob.valueOf('Example of IV123'); // Please add Text here which you want to encrypt.
Blob key = Crypto.generateAesKey(128); // Here genrating ASCI code character to secure orginal Text
Blob data = Blob.valueOf('Data to be encrypted'); // Blob is also a data type.
Blob encrypted = Crypto.encrypt('AES128', key, exampleIv, data); // Here, you can see the Algorithm Name "AES128"
Blob decrypted = Crypto.decrypt('AES128', key, exampleIv, encrypted);
String decryptedString = decrypted.toString();
System.assertEquals('Data to be encrypted', decryptedString); // Here, Receiver will get the original delivered Text value
For going in detail with encryption and decryption, please go through this URL as well AND Read about "Crypto Class"
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_crypto.htm
Please mark the best Answer. if it resolves your problem.
:)
Thank you
KSPL
1035
As you mentioned that you required "3DES Algorithm" to encrypt you Private Text or To decrypt. 3DES Algorithm is not available in Salesforce Apex class but there are other algorithms available to do the encryption and decryption. 3DES Algorithm also Decode in 64Bit unique character so you can also do same encryption or decryption using given algorithm
String algorithmName = 'RSA';
String key = '';
Blob privateKey = EncodingUtil.base64Decode(key);
Blob input = Blob.valueOf('12345qwerty');
Crypto.sign(algorithmName, input, privateKey);
Thank You
KSPL - 1035 (BODDH)