Code example for IllegalBlockSizeException

Methods: printStackTrace

0
 
        /* 加密数据 */ 
        try { 
            encryptedData = cipher.doFinal(data);
        } catch (IllegalBlockSizeException e) {
            e.printStackTrace();
        } catch (BadPaddingException e) {
            e.printStackTrace();
        } 
 
        return encryptedData;
    } 
 
    public byte[] decrypt() { 
        byte rawKeyData[] = getKey();
        DESKeySpec dks;
        Cipher cipher = null;
        InputStream file;
        byte data[] = null;
        byte decryptedData[] = null;
Stop searching for code, let great code find you!  Add Codota to your java IDE