code: async function encryptPBES1(binKey, passphrase, algorithm, iterationCount){
    // pbkdf1
    const pBuffer = jseu.encoder.stringToArrayBuffer(passphrase);
    const salt = await jscrandom.getRandomBytes(8); // defined as 8 octet
    const hash = params.passwordBasedEncryptionSchemes[algorithm].hash;
    const keyIv = await pbkdf.pbkdf1(pBuffer, salt, iterationCount, 16, hash);
    const key = keyIv.slice(0, 8);
    const iv = keyIv.slice(8, 16);
  
    // decryption
    const encrypt = params.passwordBasedEncryptionSchemes[algorithm].encrypt;
    let out;
    // TODO: Other Encryption Scheme
    if(encrypt === 'DES-CBC') {
      const CBC = des.CBC.instantiate(des.DES);
      const ct = CBC.create({type: 'encrypt', key, iv});
      out = Buffer.from(ct.update(binKey).concat(ct.final()));
    }
    else throw new Error('UnsupportedEncryptionAlgorithm');
  
    return {
      encryptionAlgorithm: {
        algorithm,
        parameters: {
          salt: Buffer.from(salt),
          iterationCount: new BN(iterationCount)
        }
      },
      encryptedData: out
    };
  }
docs: //////////////////////////// PBES1 RFC8018 Section 6.1.1