mcmilk / 7-Zip-zstd

7-Zip with support for Brotli, Fast-LZMA2, Lizard, LZ4, LZ5 and Zstandard
https://mcmilk.de/projects/7-Zip-zstd/
Other
4.87k stars 291 forks source link

Adding SM3 hashing method and whirlpool hashing method #347

Open chuhei1987 opened 10 months ago

chuhei1987 commented 10 months ago

I have review the source code, When trying to take RAR out, taking obsolete hashing function out , I'm puzzled. I like some hints how to do that above.

mcmilk commented 10 months ago

When I remove rar, some other will come and say rar support is important to me.

chuhei1987 commented 10 months ago

Can't create another branch to try out?

I am puzzled taking some bad function out from 23.01 src and try adding new things within. I like some hints for adding sha512 for hashing first.

Hermholtz commented 10 months ago

@chuhei1987 Why remove RAR support? Because of recent security vulnerability? Then maybe also remove 7z support for the same reason - https://www.zerodayinitiative.com/advisories/ZDI-23-1164/

chuhei1987 commented 10 months ago

@chuhei1987 Why remove RAR support? Because of recent security vulnerability? Then maybe also remove 7z support for the same reason - https://www.zerodayinitiative.com/advisories/ZDI-23-1164/

The question is about modules. As 7-zip is open, you can modify whatever you like.

By the way, I have a branch like that,

chuhei1987/7z2301-src/tree/Version_1 .

I now have to find ways adding new hashing method such as sha512.

Hermholtz commented 10 months ago

7-zip's strength is that it's universal, versatile and can unpack almost every format on the planet. And how you're thinking about stripping it down to remove a very big share of files that it can handle. This is unwise and childish.

chuhei1987 commented 10 months ago

7-zip's strength is that it's universal, versatile and can unpack almost every format on the planet. And how you're thinking about stripping it down to remove a very big share of files that it can handle. This is unwise and childish.

Perhaps you are right. I just prepare what if while try adding new things.

Dont worry, if you are not quite sure, then try reading these source code , compile by yourself.

WAUthethird commented 10 months ago

yeah, no, this is not the way forward I don't want to have to download WinRAR and suffer through its "please pay us" messages, thanks

chuhei1987 commented 10 months ago

yeah, no, this is not the way forward I don't want to have to download WinRAR and suffer through its "please pay us" messages, thanks

There is rar extraction module found in zstd and orginal author , which is open source, you can use that if you concent the terms. 7-zip has to provide the term to us because of using the library.

By the way, I like asking one question, how to add new hashing function such as sha512 like what we see in 7-zip ZSTD?

Hermholtz commented 10 months ago

There is rar extraction module found in zstd and orginal author , which is open source, you can use that if you concent the terms.

On the other hand you can maintain your own fork of 7-zip with any features you want, RAR ripped out, added playing Chopin songs or whatever you desire. But don't force your broken ideas to entire world and all existing users.

chuhei1987 commented 10 months ago

There is rar extraction module found in zstd and orginal author , which is open source, you can use that if you concent the terms.

On the other hand you can maintain your own fork of 7-zip with any features you want, RAR ripped out, added playing Chopin songs or whatever you desire. But don't force your broken ideas to entire world and all existing users.

I may. Perhaps the flaws found in that rar extractor is already fixed.

mcmilk commented 10 months ago

Okay, I will think about SM3 and Whirlpool - but removing rar will not be done.

MouriNaruto commented 9 months ago

I want to share something about my thoughts. Here is the content.

I'm struggle about finding a lightweight SM3 hashing implementation. (I don't want to add something like OpenSSL because it's too huge for the project.)

But I think Whirlpool hashing we can use the implementation from RHash. And here is my adaption: https://github.com/M2Team/NanaZip/blob/2.0.450/SevenZip/Extensions/RHash/WhirlpoolHandler.cpp

I hope it can make some help.

Kenji Mouri

chuhei1987 commented 9 months ago

I want to share something about my thoughts. Here is the content.

I'm struggle about finding a lightweight SM3 hashing implementation. (I don't want to add something like OpenSSL because it's too huge for the project.)

But I think Whirlpool hashing we can use the implementation from RHash. And here is my adaption: https://github.com/M2Team/NanaZip/blob/2.0.450/SevenZip/Extensions/RHash/WhirlpoolHandler.cpp

I hope it can make some help.

Kenji Mouri

Additionally, digestpp maybe a starting point for our needs.

MouriNaruto commented 9 months ago

Additionally, digestpp maybe a starting point for our needs.

About SM3 hashing, I think maybe GmSSL's implementation is lightweight enough.

Kenji Mouri

chuhei1987 commented 9 months ago

Additionally, digestpp maybe a starting point for our needs.

About SM3 hashing, I think maybe GmSSL's implementation is lightweight enough.

Kenji Mouri

There are people making that thing independent, we may try.

By the way, It is not easy finding a suitable one to add in 7-zip.