xorDecodeBytesToString method

String xorDecodeBytesToString(
  1. List<int> bytes, {
  2. String? secretKey,
})

string to bytes xor decryption

Implementation

String xorDecodeBytesToString(List<int> bytes, {String? secretKey}) {
  this.secretKey = secretKey ?? this.secretKey;
  if (this.secretKey != null && this.secretKey!.isNotEmpty) {
    return utf8.decode(_xor(bytes, utf8.encode(this.secretKey!)));
  } else {
    return utf8.decode(_decrypt(bytes));
  }
}