public void encrypt(InputStream in, OutputStream out) throws Exception {
        // Symmetrically Encrypted Data Packet
        byte version = 4;
        int block_size = ecipher.getBlockSize();
        int len = 0;
        byte[] buf = new byte[184];
        int add = 0;
        int packet_len;
        byte[] padded_buf;
        System.out.println("Encrypted file:: ");
        while ((len = in.read(buf)) >= 0) {
            System.out.println(new String(buf));
            out.write((byte) SEDP_TAG & 0xff);
            // pad with 0 for
            if ((len % block_size) != 0) {
                add = block_size - (len - block_size * (len / block_size));
                padded_buf = new byte[len + add];
                Arrays.fill(padded_buf, (byte) 0);
                for (int i = 0; i < len + add; ++i)
                    padded_buf[i] = buf[i];
            }
            packet_len = len + add + 1 + 1 + 1;  // data + padding + version + sym_alg_id + S2K
            out.write((byte) packet_len & 0xff);
            out.write(version & 0xff);
            out.write(TRIPLEDES_ID & 0xff);
            out.write(S2K_reserved & 0xff);
            byte[] cipher_text = new byte[len + add];
            len = ecipher.update(buf, 0, len + add, cipher_text);
            out.write(cipher_text, 0, len);
            Arrays.fill(buf, (byte) 0);
        }
        out.flush();
    }