4

Is it possible if I want to create my application that need to zip the video and user must have password authentication to open file ?

If it poosible , could you guys provide me some of example code ? Thanks , Regards

Valentin Rocher
  • 11,667
  • 45
  • 59
Jutikorn
  • 838
  • 1
  • 11
  • 25
  • 8
    I'm aware that english isn't your mother tongue but that should only encourage you to proof read your questions. Not all of us may be gay so please rephrase that to guys. Thanks. – Octavian Helm Nov 12 '10 at 08:17

2 Answers2

2

Try something like this:

OutputStream out = new ZipOutputStream(new CipherOutputStream(new FileOutputStream(...)), cipher);

And the other way around:

InputStream in = new ZipInputStream(new CipherInputStream(new FileInputStream(...)), cipher);

For creating the cipher, see: http://developer.android.com/reference/javax/crypto/Cipher.html

Timo Ohr
  • 7,947
  • 2
  • 30
  • 20
0

I'm not sure what you exactly need, But if you want to have password protected zip files you can use this library: Here are some code snippets taken from there:

Zip:

ZipArchive zipArchive = new ZipArchive();
zipArchive.zip(targetPath,destinationPath,password);

Unzip:

ZipArchive zipArchive = new ZipArchive();
zipArchive.unzip(targetPath,destinationPath,password);
Milad Faridnia
  • 9,113
  • 13
  • 65
  • 78