private Cipher getPattern(String type, int cipherMode) throws Exception {
        Cipher cipher;
        switch (type){
            case CBC :
                cipher = Cipher.getInstance(DES_CBC_PKCS5PADDING);
                cipher.init(cipherMode, key, IV);
                break;
            case OFB :
                cipher = Cipher.getInstance(DES_OFB_PKCS5PADDING);
                cipher.init(cipherMode, key, IV);
                break;
            case CFB :
                cipher = Cipher.getInstance(DES_CFB_PKCS5_PADDING);
                cipher.init(cipherMode, key, IV);
                break;
            default :
                cipher = Cipher.getInstance(DES);
                cipher.init(cipherMode, key);
                break;
        }
        return cipher;
    }
Initialize cipher
@param type  Encryption/decryption mode (ECB/CBC/OFB/CFB)
@param cipherMode cipher working mode 1: encryption; 2: decryption
@return cipher
@throws Exception exception
@author sucb
@date March 2, 2017 7:49:16 pm
chat2db-server/chat2db-server-domain/chat2db-server-domain-core/src/main/java/ai/chat2db/server/domain/core/util/DesUtil.java