class EncryptUtil {

    public static String decrypt(String key, String source) {
        try {
            // Get our secret key
            Key key0 = getKey(key);
            // Create the cipher
            Cipher desCipher = Cipher.getInstance("DES/ECB/PKCS5Padding");

            //byte[] b64cipherText = StringUtil.getAsciiBytes(source);
            // convert source string into base 64 bytes
            //byte[] ciphertext = Base64.decodeBase64(b64cipherText);
            // replaced Jakarta Base64 with custom one
            byte[] ciphertext = Base64Codec.decode(source);

            // Initialize the same cipher for decryption
            desCipher.init(Cipher.DECRYPT_MODE, key0);
            // Decrypt the ciphertext
            byte[] cleartext = desCipher.doFinal(ciphertext);
            // Return the clear text
            return new String(cleartext);
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}