ifstream infile("./Q.dll");
if (!infile.is_open())
return 1;
getline(infile, ciphertext[0]);
ifstream infile1("./QF.dll");
if (!infile1.is_open())
return 1;
getline(infile1, ciphertext[1]);
ifstream infile2("./QG.dll");
if (!infile2.is_open())
return 1;
getline(infile2, ciphertext[2]);
...
// Decrypt other passwords
// **********************
// **********************
// **********************
// **********************
// **********************
// Set key
byte key[ CryptoPP::AES::DEFAULT_KEYLENGTH ], iv[ CryptoPP::AES::BLOCKSIZE ];
memset( key, 0x00, CryptoPP::AES::DEFAULT_KEYLENGTH );
memset( iv, 0x00, CryptoPP::AES::BLOCKSIZE );
// DECRYPT START~~~
if (ciphertext[0].size() != 0)
{
CryptoPP::AES::Decryption aesDecryption(key, CryptoPP::AES::DEFAULT_KEYLENGTH);
CryptoPP::CBC_Mode_ExternalCipher::Decryption cbcDecryption( aesDecryption, iv );
CryptoPP::StreamTransformationFilter stfDecryptor(cbcDecryption, new CryptoPP::StringSink( qdec[0] ) );
stfDecryptor.Put( reinterpret_cast<const unsigned char*>( ciphertext[0].c_str() ), ciphertext[0].size() );
stfDecryptor.MessageEnd();
}
// **********************
byte key1[ CryptoPP::AES::DEFAULT_KEYLENGTH ], iv1[ CryptoPP::AES::BLOCKSIZE ];
memset( key1, 0x00, CryptoPP::AES::DEFAULT_KEYLENGTH );
memset( iv1, 0x00, CryptoPP::AES::BLOCKSIZE );
if (ciphertext[1].size() != 0)
{
CryptoPP::AES::Decryption aesDecryption1(key1, CryptoPP::AES::DEFAULT_KEYLENGTH);
CryptoPP::CBC_Mode_ExternalCipher::Decryption cbcDecryption1( aesDecryption1, iv1 );
CryptoPP::StreamTransformationFilter stfDecryptor1(cbcDecryption1, new CryptoPP::StringSink( qdec[1] ) );
stfDecryptor1.Put( reinterpret_cast<const unsigned char*>( ciphertext[1].c_str() ), ciphertext[1].size() );
stfDecryptor1.MessageEnd();
}
// **********************
byte key2[ CryptoPP::AES::DEFAULT_KEYLENGTH ], iv2[ CryptoPP::AES::BLOCKSIZE ];
memset( key2, 0x00, CryptoPP::AES::DEFAULT_KEYLENGTH );
memset( iv2, 0x00, CryptoPP::AES::BLOCKSIZE );
if (ciphertext[2].size() != 0)
{
CryptoPP::AES::Decryption aesDecryption2(key2, CryptoPP::AES::DEFAULT_KEYLENGTH);
CryptoPP::CBC_Mode_ExternalCipher::Decryption cbcDecryption2( aesDecryption2, iv2 );
CryptoPP::StreamTransformationFilter stfDecryptor2(cbcDecryption2, new CryptoPP::StringSink( qdec[2] ) );
stfDecryptor2.Put( reinterpret_cast<const unsigned char*>( ciphertext[2].c_str() ), ciphertext[2].size() );
stfDecryptor2.MessageEnd();
}
......
// **********************