public void decrypt(RandomAccessFile in, OutputStream out) throws Exception {
        int block_size = dcipher.getBlockSize();
        int read = 0;
        byte[] header = new byte[2];
        int len = 0;
        System.out.println("Decrypted file:: ");
        while (in.read(header, 0, 2) != -1 && ((header[0] & 0xff) == SEDP_TAG)) {
            len = header[1] & 0xff;
            byte version = (byte) in.read();
            in.read();  // sym_alg
            in.read();  // s2k
            len -= 3;
            if ((len % block_size) != 0)
                len += block_size - (len - block_size * (len / block_size));
            byte[] buf = new byte[len];
            read = in.read(buf, 0, len);
            byte[] decrypted = new byte[len];
            dcipher.update(buf, 0, read, decrypted);
            int j;
            for (j = decrypted.length; decrypted[j - 1] == (byte) 0x00; j--)
                len--;
            out.write(decrypted, 0, len & 0xff);
            System.out.println(new String(decrypted));
        }
    }