mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-22 06:38:11 +00:00
UnRAR: Allow using key and IV instead of password
This commit is contained in:
parent
007913dfa7
commit
be4e3df01b
5
deps/unrar/crypt.cpp
vendored
5
deps/unrar/crypt.cpp
vendored
@ -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)
|
||||
|
1
deps/unrar/crypt.hpp
vendored
1
deps/unrar/crypt.hpp
vendored
@ -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);
|
||||
|
7
deps/unrar/rdwrfn.cpp
vendored
7
deps/unrar/rdwrfn.cpp
vendored
@ -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()
|
||||
|
1
deps/unrar/rdwrfn.hpp
vendored
1
deps/unrar/rdwrfn.hpp
vendored
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user