mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
.
This commit is contained in:
@ -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;
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user