|
|
@ -109,14 +109,14 @@ func DecryptDataPng(f *os.File, fout *os.File) {
|
|
|
|
salt = append(salt, saltChunk.data...)
|
|
|
|
salt = append(salt, saltChunk.data...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var data []byte
|
|
|
|
var data []byte
|
|
|
|
for _, cryptChunk := range png.GetChunksByName(chunkName) {
|
|
|
|
for i, cryptChunk := range png.GetChunksByName(chunkName) {
|
|
|
|
|
|
|
|
if !cryptChunk.Verify() {
|
|
|
|
|
|
|
|
log.Fatalf("Corrupted chunk data, chunk #%d", i)
|
|
|
|
|
|
|
|
}
|
|
|
|
data = append(data, cryptChunk.data...)
|
|
|
|
data = append(data, cryptChunk.data...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(data) > 0 {
|
|
|
|
if len(data) > 0 {
|
|
|
|
data, err = decryptData(data, salt)
|
|
|
|
data, err = decryptData(data, salt)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.Println("\nThe provided password is probably incorrect.")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
check(err)
|
|
|
|
check(err)
|
|
|
|
_, err = fout.Write(data)
|
|
|
|
_, err = fout.Write(data)
|
|
|
|
check(err)
|
|
|
|
check(err)
|
|
|
|