Skip to content

Instantly share code, notes, and snippets.

@srujan21
Created June 7, 2022 13:29
Show Gist options
  • Save srujan21/f73099c3666f1d2c7babdb82800d473c to your computer and use it in GitHub Desktop.
Save srujan21/f73099c3666f1d2c7babdb82800d473c to your computer and use it in GitHub Desktop.
recordid=ApexPages.currentPage().getParameters().get('CA_Info');
if(recordid!=null && recordid!='')
{
if(recordid.contains(' '))
recordid=recordid.replace(' ','+');
Blob cryptoKey = Blob.valueOf('lmf456ert0123acf');
Blob exampleIv = Blob.valueOf('0ydioopwur12IV12');
Blob data = Encodingutil.base64Decode(String.valueOf(recordid));
Blob decryptedData = Crypto.decrypt('AES128', cryptoKey , exampleIv, data);
recordid= decryptedData.toString();
System.debug('recordid ***' + recordid);
lstuserId = [SELECT Email,ProfileId,Username FROM User where id = :System.Label.Mirror_Credit_Guest_User limit 1];
System.debug('Found user: '+lstuserId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment