Symmetric Tactical Assertion : Receiver unable to decrypt results from encrypted output

Document ID : KB000107676
Last Modified Date : 24/07/2018
Show Technical Document Details
Question:
When using the SymetricEncryptionTacticalAssertion.saar.   The receiver of the encrypted output is not able to decrypt the data generated from the tactical assertion. It is unclear from the documentation how does one process the output to get the IV (Initialization vector).
Answer:

For encryption the IV (initialization vector) is randomly generated, and then it is pre-pended to the encrypted bytes . 

So the first X bytes of the returned bytearray will be the iv that was used. 

Where X depends on the block size of the cipher : Which is coded as : 

IV_BLOCK_SIZE_BYTES_AES = 16 
IV_BLOCK_SIZE_BYTES_AES_GSM = 12 
IV_BLOCK_SIZE_BYTES_DES_TRIPPLE_DES = 8 

So the first X bytes of the returned packet are the initial IV string.