This commit is contained in:
ElenaSubbotina
2018-10-04 11:32:05 +03:00
parent 1102f7f9b0
commit 9105894416
2 changed files with 18 additions and 18 deletions

View File

@ -205,26 +205,26 @@ bool OoxConverter::encrypt_file (const std::wstring &password, const std::wstrin
CRYPT::_odfCryptData cryptData;
//-----------------------
//aes
//cryptData.cipherAlgorithm = CRYPT_METHOD::AES_CBC;
//cryptData.start_hashAlgorithm = CRYPT_METHOD::SHA256;
//cryptData.start_hashSize = 32;
cryptData.cipherAlgorithm = CRYPT_METHOD::AES_CBC;
cryptData.start_hashAlgorithm = CRYPT_METHOD::SHA256;
cryptData.start_hashSize = 32;
//cryptData.spinCount = 100000;
//cryptData.keySize = 32;
//cryptData.checksum_size = 1024;
//cryptData.checksum_hashAlgorithm = CRYPT_METHOD::SHA256;
//-----------------------
//blowfish
cryptData.cipherAlgorithm = CRYPT_METHOD::Blowfish_CFB;
cryptData.start_hashAlgorithm = CRYPT_METHOD::SHA1;
cryptData.start_hashSize = 20;
cryptData.spinCount = 1024;
cryptData.keySize = 7;//16;
cryptData.spinCount = 100000;
cryptData.keySize = 32;
cryptData.checksum_size = 1024;
cryptData.checksum_hashAlgorithm = CRYPT_METHOD::SHA1;
cryptData.checksum_hashAlgorithm = CRYPT_METHOD::SHA256;
//-----------------------
//blowfish
//cryptData.cipherAlgorithm = CRYPT_METHOD::Blowfish_CFB;
//cryptData.start_hashAlgorithm = CRYPT_METHOD::SHA1;
//cryptData.start_hashSize = 20;
//cryptData.spinCount = 1024;
//cryptData.keySize = 7;//16;
//cryptData.checksum_size = 1024;
//cryptData.checksum_hashAlgorithm = CRYPT_METHOD::SHA1;
//-----------------------
NSFile::CFileBinary file;

View File

@ -585,7 +585,7 @@ bool ReadStandartEncryptionInfo(unsigned char* data, int size, _ecmaCryptData &
unsigned long szEncryptedVerifierHash = (ProviderType == 0x0001) ? 0x14 : 0x20; // RC4 | AES(DES)
unsigned long szEncryptedVerifierHashMax = mem_stream.GetSize() - mem_stream.GetPosition();
cryptData.encryptedVerifierValue = std::string((char*)data + mem_stream.GetPosition(), max(szEncryptedVerifierHash, szEncryptedVerifierHashMax));
cryptData.encryptedVerifierValue = std::string((char*)data + mem_stream.GetPosition(), (std::max)(szEncryptedVerifierHash, szEncryptedVerifierHashMax));
mem_stream.ReadBytes(szEncryptedVerifierHash, false);
pos = mem_stream.GetPosition();