Looking at the latest release (1.2) zip package - how can I unzip a file that was password protected (using 7zip, AES-256 encoding)? I don\'t see where/how to add in that i
https://github.com/yeka/zip provides functionality to extract password protected zip file (AES & Zip Standard Encryption aka ZipCrypto).
Below is an example how to use it:
package main
import (
"os"
"io"
"github.com/yeka/zip"
)
func main() {
file := "file.zip"
password := "password"
r, err := zip.OpenReader(file)
if nil != err {
panic(err)
}
defer r.Close()
for _, f := range r.File {
f.SetPassword(password)
w, err := os.Create(f.Name)
if nil != err {
panic(err)
}
io.Copy(w, f)
w.Close()
}
}
The work is a fork from https://github.com/alexmullins/zip which add support for AES only.