encryptPk1 static method

List<int> encryptPk1(
  1. Uint8List data,
  2. int length,
  3. String key
)

Implementation

static List<int> encryptPk1(Uint8List data, int length, String key) {
  List<int> keyList = key.codeUnits;
  List<int> res = [];
  for (int i = 0; i < length; i++) {
    final inter = assemblyPk1(keyList);
    final cfc = inter >> 8;
    final cfd = inter & 0xff;
    var c = data[i];
    for (int j = 0; j < keySize; j++) {
      keyList[j] ^= c;
    }
    c ^= (cfc ^ cfd);
    res.add(c);
  }
  return res;
}