1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-21 23:58:07 +00:00

UnRAR: Allow using key and IV instead of password

This commit is contained in:
philsmd 2020-09-08 10:39:21 +02:00
parent 007913dfa7
commit be4e3df01b
No known key found for this signature in database
GPG Key ID: 4F25D016D9D6A8AF
4 changed files with 14 additions and 0 deletions

View File

@ -91,6 +91,11 @@ bool CryptData::SetCryptKeys(bool Encrypt,CRYPT_METHOD Method,
return true;
}
void CryptData::SetRijndalDecryptKey(byte *Key,byte *InitV)
{
CryptData::Method=CRYPT_RAR30;
rin.Init(false,Key,128,InitV);
}
// Use the current system time to additionally randomize data.
static void TimeRandomize(byte *RndBuf,size_t BufSize)

View File

@ -81,6 +81,7 @@ class CryptData
bool SetCryptKeys(bool Encrypt,CRYPT_METHOD Method,SecPassword *Password,
const byte *Salt,const byte *InitV,uint Lg2Cnt,
byte *HashKey,byte *PswCheck);
void SetRijndalDecryptKey(byte *Key,byte *InitV);
void SetAV15Encryption();
void SetCmt13Encryption();
void EncryptBlock(byte *Buf,size_t Size);

View File

@ -292,6 +292,13 @@ void ComprDataIO::SetEncryption(bool Encrypt,CRYPT_METHOD Method,
#endif
}
void ComprDataIO::InitRijindal(byte *Key,byte *InitV)
{
#ifndef RAR_NOCRYPT
Decryption=true;
Decrypt->SetRijndalDecryptKey(Key,InitV);
#endif
}
#if !defined(SFX_MODULE) && !defined(RAR_NOCRYPT)
void ComprDataIO::SetAV15Encryption()

View File

@ -70,6 +70,7 @@ class ComprDataIO
void SetSubHeader(FileHeader *hd,int64 *Pos) {SubHead=hd;SubHeadPos=Pos;}
void SetEncryption(bool Encrypt,CRYPT_METHOD Method,SecPassword *Password,
const byte *Salt,const byte *InitV,uint Lg2Cnt,byte *HashKey,byte *PswCheck);
void InitRijindal(byte *Key,byte *InitV);
void SetAV15Encryption();
void SetCmt13Encryption();
void SetUnpackToMemory(byte *Addr,uint Size);