Home > utility > encodeXor.m

encodeXor

PURPOSE ^

encodeXor: data encoding using xor

SYNOPSIS ^

function out = encodeXor(in, xorKey);

DESCRIPTION ^

encodeXor: data encoding using xor

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function out = encodeXor(in, xorKey);
0002 %encodeXor: data encoding using xor
0003 
0004 %    Roger Jang, 20051202
0005 
0006 out=in;
0007 xorKey=abs(xorKey);
0008 for i=1:length(out)
0009     j=mod(i-1, length(xorKey))+1;
0010     out(i)=bitxor(out(i), xorKey(j));
0011 end

Generated on Tue 01-Jun-2010 09:50:34 by m2html © 2003