Last active
March 13, 2021 11:03
-
-
Save muhaisen/f8eb96cdd2d7391a382744f1ee240124 to your computer and use it in GitHub Desktop.
Gets the cipher text from Salesforce encryptWithManagedIV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Retivers the cipher text without the IV | |
/// </summary> | |
/// <param name="base64_cipher_text"></param> | |
/// <returns></returns> | |
public static byte[] RetrieveCipher(string base64_cipher_text) | |
{ | |
byte[] cipher_binary = Convert.FromBase64String(base64_cipher_text); | |
var length = cipher_binary.Length - 16; | |
byte[] cipher_only = new byte[length]; | |
Array.Copy(cipher_binary, 16, cipher_only, 0, length); | |
return cipher_only; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment