newbie here. so consider this paradox: let's say you have a pass protected rar file. now the password should be stored somewhere in the file to compare against the inputted password. so if it's there how come you cant just extract it?
so consider this paradox
Why does no-on on /prog/ ever use the word paradox correctly
Name:
Anonymous2010-04-30 16:25
I don't know anything about RAR encryption beyond the fact that it uses AES, but I'm assuming it just tries to decrypt with the password the user provides and errors out when the first few blocks don't form a legitimate RAR header. That would make a lot more sense than storing the password in the file, which would be a retarded idea..
Name:
Anonymous2010-04-30 16:48
>>1
Alternatively you can store the cryptographic hash of the password, which would be a bitch to reverse.
>>7
a checksum is really just a hash, so yeah, encryption.
Name:
Anonymous2010-04-30 17:24
>>7
There's certainly a cleartext header at the start of an encrypted RAR file, but do you have a citation for the presence of any checksum or any reason to believe the payload isn't just a straightforward encrypted RAR file? It's annoyingly hard to find good information on the topic (mainly thanks to idiots like >>1 who are just looking for crackers), and I don't particularly want to spend my evening poring over a clusterfuck of Sepples code.
>>10
I don't have references, just experience. An example is when I enter the wrong password my local unrar doesn't know for sure what's wrong, complaining of a bad CRC and suggesting that since it needs a password, perhaps I got it wrong. Otherwise bad CRC is always reported as a corrupt archive. I'd say that's fairly conclusive.
I know that the CRCs are not part of the payload (this would be pretty fucking stupid if you think about it.) However, there are two ways to produce rar files (encrypted or not), one is pkzip-style (a collection of compressed files) and the other is tgz-style (a compressed collection of files--"solid" compression.) It's common to use solid compression on the unencrypted format, and the other form on encrypted files (from observation.) I do believe these are the defaults for virtually every rar compressor, though I have found at least one encrypted rar with solid compression. With the solid encrypted format, from observation, there is still a CRC in the clear. I expect there are individual CRCs to be found in a subheader as well, but I really didn't check. I do believe there is a "TOC"/subheader is encrypted in this case, but I don't remember this part clearly.
Name:
122010-04-30 17:45
I do believe there is a "TOC"/subheader which is encrypted in this case,
Name:
Anonymous2010-04-30 17:51
>>12
From your description it really sounds more as if it's trying to decrypt the payload directly and then compare the results with a CRC in the header, and not at all storing a hash of the password anywhere. So >>9 is wrong.
>>14
No, there's certainly no password stored in the file (and there's really no need, since checksums are desirable even without encryption.) That is almost never the road taken to password protected files. The old utilities tended to use XOR without CRCs, but they could be cracked quickly (since XOR is fast) and easily by a substring search, unless the key is really long--like OTP.
But you could look at it as analogous to one-way password encryption in the sense that you have to match the CRC with the decrypted file. This analogy quickly falls apart when you investigate the nuances though.
1. The RAR file format (not compression algorithm) has official documentation
2. There are two opensource (not really "free", you RMS-obsessed neckbreads) implementations able to extract all versions of the format, including any combination of solid archiving and encryption
3. The defaults of all shipping RAR versions (there's only one RAR compressor) have been not solid and not encrypt headers ("file names" in UI and docs). Anything else has been explicitly specified by the user
The UnRAR source is fucking trivial to read, it took me literally 10 minutes to figure out the main compression algorithm, plus another 5 for the VM stuff. If you can't answer "why is 2040:1 the maximum compression ratio for the LZH backed" after looking at it for 5 minutes, well, you just suck. The PPMD backed I haven't really looked into. The actual container format is dead easy, I'm not answering your kindergarten questions.
Name:
Anonymous2010-05-01 7:50
>>16
Why is 2040:1 the maximum compression ratio for the LZH backed?
OP here. so consider another paradox: let's say you have a simple rar file. now you compress it with rar again. rar usually compresses files by 30-50%. so you compress it again and again and it's getting smaller. so the paradox: at some point it will become just a couple of bytes, how is that possible?
i think that's impossible b/c it would require infinite processing power but im not sure tho, whats your opinion guys?
Name:
Anonymous2010-05-02 15:07
>>30
WOW YEAH OMG INFINITE COMPRESSION IS POSSIBLES
Name:
Anonymous2010-05-02 15:07
>>30
That's why we have all those international conventions which prohibit using RAR any more than a few dozen times, otherwise there would be too many paradoxen.
>>30
When I was younger I knew this wouldn't work. However! I was a clever bastard, and I XOR encrypted the resulting file (with only a 32-bit key) and compressed again. Instead of wasting space (at optimal compression), I was able to get another roughly 10%. Lather, rinse, repeat--even with the same key1 the results continued to be favourable for as long as I cared to do it, which admittedly wasn't very long, for I was doing this with a 486 and each pass was taking longer and longer.
_________________________________________________________
1. Do you know the reason for this restriction?
Name:
Anonymous2010-05-02 16:22
>>34 1. Do you know the reason for this restriction?
Because the key was of type frozenvoid*.
Name:
Anonymous2010-05-02 19:40
>>33
that's easy if your entropy pool is low, since /dev/urandom never blocks.
unless you're using a superior operating system like freebsd.
>>36
The fact that /dev/urandom never blocks doesn't mean it'll just put out a series of 0s once its entropy runs out. Random noise generated by a PRNG is just as incompressible as ``genuine'' randomness.
>>37 Random noise generated by a PRNG is just as incompressible as ``genuine'' randomness.
That is inherently untrue in principle, with a caveat. Practically speaking, though, bzip isn't going to do the trick.
The caveat being that a system with sufficiently greater resources could generate a sequence that in principle could not be compressed by a system with inferior resources, though abstractly it is still a compressible sequence.
Americangarbage: deflate/gzip/zlib, zip "encryption" Englishmediocrity: bzip(2) Russianglory: rar/ppmd/lzma, rar/7z encryption; Alex Ratushnyak winner of Hutter Prize and Calgary Corpus Compression Challenge