public byte[] ProcessIncoming(byte[] data) { try { return(CryptoHelper.SymmetricDecryptHMACIV(data, sessionKey, hmacSecret)); } catch (CryptographicException ex) { DebugLog.WriteLine(nameof(NetFilterEncryptionWithHMAC), "Unable to decrypt incoming packet: " + ex.Message); // rethrow as an IO exception so it's handled in the network thread throw new IOException("Unable to decrypt incoming packet", ex); } }