Our security team has found an issue in our lightning experience site where a link to an external system is adding the account # in the URL. That system is then using that account # to display data on their site related to the account.
This means any user who can access this link can modify the account # in the URL and see other people's data in the external system (big oops to whomever designed that).
I was thinking the easiest way to fix this is to encrypt the account # so the external system can still grab the encrypted # from the URL, decrypt it, and show the correct information.
Below is the code I created to encrypt this account # in Apex (This is just a sample key):
private static final Blob KEY = EncodingUtil.base64Decode('ZZZB0LSDWRlPSpOR3LgqSpZdN0DCJYcxohJ/K3oPsA=');
private static String encryptString(String clearText) {
Blob encryptedBlob = Crypto.encryptWithManagedIV('AES256', KEY, Blob.valueOf(clearText));
String encryptedText = EncodingUtil.base64Encode(encryptedBlob);
return encryptedText;
}
I told the external systems developer to use the key provided above as well as AES256
to decrypt the value and he says this isn't enough info.
How can I encrypt a value in a way where another system can decrypt it? Is it as simple as giving him the key and the encryption method (AES256
)?
Thanks