bmx-ng / archive.mod

Archives!
BSD 2-Clause "Simplified" License
3 stars 1 forks source link

Zipcryt, aes256, etc.. are not working on 7z.mod #11

Open BirmLarm opened 1 year ago

BirmLarm commented 1 year ago

Hello. Can you please fix the issue... when I'm creating a 7z file and adding a password to it, the output file is not an encrypted 7z file. The "Encrypted Method" is not working on 7z.mod but in zip.mod, zipcrypt is working well except for the aes256.

BirmLarm commented 1 year ago

And also how to add a folder, sir? with the modified date of the folder? I added a folder in my archive file but the date is 1980 instead of the current date of the folder. :"(

image

BirmLarm commented 1 year ago

and also i already tried the filetime but it didnt work.

local IN:stream=writestream ("NewDateForFolder.txt") if IN then IN.close() local getftime:long=filetime ("NewDateForFolder.txt")

archy.AddEntry("", "My Pictures", 0, getftime, EArchiveFileType.Dir)

GWRon commented 1 year ago

Please provide a sample showing how you create an encrypted zip archive.

Also add an example doing that folder stuff.

BirmLarm commented 1 year ago

same process in the archive samples, sir. :)

BirmLarm commented 1 year ago

SuperStrict

Framework Archive.Zip Import brl.standardio

Local wa:TWriteArchive = New TWriteArchive wa.SetFormat(EArchiveFormat.ZIP) wa.SetCompressionLevel(9)

wa.Open("data.zip")

wa.AddEntry("testdata.txt", "files/testdata.txt") wa.AddEntry("테스트_데이터.txt", "files/테스트_데이터.txt") wa.AddEntry("", "empty", 0, 0, EArchiveFileType.Dir)

wa.Close()

Local entry:TArchiveEntry = New TArchiveEntry

Local ra:TReadArchive = New TReadArchive ra.SetFormat(EArchiveFormat.ZIP) ra.Open("data.zip")

While ra.ReadNextHeader(entry) = ARCHIVE_OK Print "File : " + entry.Pathname() Print "Size : " + entry.Size() Print "Type : " + entry.FileType().ToString() Local s:String = LoadText(ra.DataStream()) Print "String size : " + s.length Print "First n chars : " + s[0..17] Print Wend

ra.Free()

BirmLarm commented 1 year ago

:)))))))))))))))))))

image

GWRon commented 1 year ago

Regarding modified time: the issue is that the current code only sets the modified time for files, not directories. Will push a PR for it.

Local nowTime:SDatetime = New SDatetime(2023, 7, 21, 11, 23, 0)
wa.AddEntry("", "empty", 0, nowTime.ToEpochSecs(), EArchiveFileType.Dir)

results then here in: image (as it is using UTC)

Using my local time:

Local nowTime:SDatetime = New SDatetime(2023, 7, 21, 11, 23, 0, 0, False)
wa.AddEntry("", "empty", 0, nowTime.ToEpochSecs(), EArchiveFileType.Dir)

results then in image

GWRon commented 1 year ago

zip with AES256: more details can be found in the already existing issue here: #1

woollybah commented 1 year ago

libarchive doesn't appear to support 7zip encryption yet.

BirmLarm commented 1 year ago

oh i thought it was already updated 17 hours ago... and i tried it... and yep! still the same.

image

BirmLarm commented 1 year ago

libarchive doesn't appear to support 7zip encryption yet.

I can wait you to update it, sir . ^-^ . Thank you for keep polishing your Blitzmax. God bless u always.

GWRon commented 1 year ago

Libarchive is 3rd party.

oh i thought it was already updated 17 hours ago... and i tried it... and yep! still the same.

A PR means "here, I made this change, would you merge it into the code?" - means you can update as much as you want until a PR is not merged into. See it as a "suggestion" for the maintainer of the repository. (and as I committed 2 files I did not want to commit Brucey correctly did not merge it yet).