Dim KEY_OFFSET As Long Dim bytKey() As Byte Dim bytData() As Byte Dim lNum As Long '...Set values for the various variables, then: For lNum = LBound(bytData) To UBound(bytData) If lNum Mod 2 Then bytData(lNum) = bytData(lNum) Xor (bytKey(lNum) + KEY_OFFSET) Else bytData(lNum) = bytData(lNum) Xor (bytKey(lNum) - KEY_OFFSET) End If Next lNumI can ( or at least I think I can ) get most of the entities translated, i.e. the arrays bounds, Mod, and Xor I can translate. I am using T-SQL varbinary() for the equivalent VB byte arrays and the specific problem I am wrestling with is how to "replace" bits ( bytes? ) in the varbinary() variable like is done with the
bytData(lNum) = bytData(lNum) Xor (bytKey(lNum) + KEY_OFFSET)VB statement.