PBECipherCore(String cipherAlg) throws NoSuchAlgorithmException, NoSuchPaddingException {
  algo=cipherAlg;
  if (algo.equals("DES")) {
    cipher=new CipherCore(new DESCrypt(),DESConstants.DES_BLOCK_SIZE);
  }
 else   if (algo.equals("DESede")) {
    cipher=new CipherCore(new DESedeCrypt(),DESConstants.DES_BLOCK_SIZE);
  }
 else {
    throw new NoSuchAlgorithmException("No Cipher implementation " + "for PBEWithMD5And" + algo);
  }
  cipher.setMode("CBC");
  cipher.setPadding("PKCS5Padding");
  md=MessageDigest.getInstance("MD5");
}

PBECipherCore ( String cipherAlg ) throws NoSuchAlgorithmException , NoSuchPaddingException { algo = cipherAlg ; if ( algo . equals ( "DES" ) ) { cipher = new CipherCore ( new DESCrypt ( ) , DESConstants . DES_BLOCK_SIZE ) ; } else if ( algo . equals ( "DESede" ) ) { cipher = new CipherCore ( new DESedeCrypt ( ) , DESConstants . DES_BLOCK_SIZE ) ; } else { throw new NoSuchAlgorithmException ( "No Cipher implementation " + "for PBEWithMD5And" + algo ) ; } cipher . setMode ( "CBC" ) ; cipher . setPadding ( "PKCS5Padding" ) ; md = MessageDigest . getInstance ( "MD5" ) ; }
creates an instance of pbe cipher using the specified cipherspi instance .
