algorithm property

int get algorithm

Determine the encryption algorithm in use.

Implementation

int get algorithm {
  if (version == 1 || version == 2) {
    return keyLength <= 40 ? algorithmRC4_40 : algorithmRC4_128;
  }
  if (version == 4) {
    final cf = encryptDict.getDict('CF');
    if (cf != null) {
      final stdCf = cf.getDict('StdCF');
      if (stdCf != null) {
        final cfm = stdCf.getName('CFM');
        if (cfm == 'AESV2') return algorithmAES_128;
      }
    }
    return algorithmRC4_128;
  }
  if (version == 5) return algorithmAES_256;
  return algorithmNone;
}