Android zip file authentication

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


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


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);
链接地址: http://www.djcxy.com/p/57010.html

上一篇: 有关用于压缩文件的免费库的建议

下一篇: Android zip文件认证