· 6 years ago · Jul 06, 2019, 01:06 PM
1KeyGenerator kgen = KeyGenerator.getInstance("AES");
2 SecretKey skey = kgen.generateKey();
3 encipher.init(Cipher.ENCRYPT_MODE, skey);
4 CipherInputStream cis = new CipherInputStream(fis, encipher);
5 decipher.init(Cipher.DECRYPT_MODE, skey);
6 CipherOutputStream cos = new CipherOutputStream(decfos,decipher);
7
8 while((read = cis.read())!=-1)
9 {
10 fos.write((char)read);
11 fos.flush();
12 }
13 fos.close();
14 while((read=encfis.read())!=-1)
15 {
16 cos.write(read);///want this part to be done while the prev decoded parts are playing through videoVIEW
17 cos.flush();
18 }
19cos.close();