首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

有跟java通用的des加密吗

2013-08-09 
有和java通用的des加密吗?java代码:private static final String DES DESprivate static final Strin

有和java通用的des加密吗?
java代码:

    private static final String DES = "DES";
    private static final String MODEL = "DES/CBC/PKCS5Padding";
    public static String encryptDES(String encrypeString, String encrypetKey) {
        byte[] encryptedData = null;
        try {
            IvParameterSpec zeroIv = new IvParameterSpec(IV);
            SecretKeySpec key = new SecretKeySpec(encrypetKey.getBytes(), DES);
            Cipher cipher = Cipher.getInstance(MODEL);
            cipher.init(Cipher.ENCRYPT_MODE, key, zeroIv);
            encryptedData = cipher.doFinal(encrypeString.getBytes());

        } catch (Exception e) {
            e.printStackTrace();
        }
        return Base64.encode(encryptedData);
    }

delphi要怎么弄 找了好几个都不行

热点排行