byteXor method

Uint8List byteXor(
  1. Uint8List data,
  2. Uint8List key
)

Binary XOR encryption

Implementation

Uint8List byteXor(Uint8List data, Uint8List key) {
  List<int> output = [];

  for (var i = 0; i < data.length; i++) {
    var charCode = data[i] ^ key[i % key.length];
    output.add(charCode);
  }

  return output.toUint8List();
}