Category : aes

I’m currently writing a C++ software which have to be compatible with a legacy network service. The encryption/decryption which is used by that service is AES-128-OFB-PKCS#7(yes, it pads the data in OFB mode). Because OFB mode does not require padding OpenSSL does not apply or remove such padding which gives me the troubles. I’ve been ..

Read more

I want to encrypt all the files in the test folder This works successfully for text files But not for binaries Source Code : void l(string& foldername, vector<string>& output) { DIR* dir; struct dirent* DirEntry; if ((dir = opendir(foldername.c_str())) != NULL) { while ((DirEntry = readdir(dir)) != NULL) { if (strcmp(DirEntry->d_name, ".") && strcmp(DirEntry->d_name, "..")) ..

Read more

I want to encrypt a binary file This is not done But it is done for text files But it does not encrypt the binary file Code : SecByteBlock key(AES::MAX_KEYLENGTH + AES::BLOCKSIZE); HKDF<SHA256> s256; s256.DeriveKey(key, key.size(), (const CryptoPP::byte*)pa.data(), pa.size(), (const CryptoPP::byte*)iv.data(), iv.size(), NULL, 0); ifstream file("1.rar", ios::binary); std::string t((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>()); if (file.is_open()) { string enc; ..

Read more