Sarajevo, Bosnia and Herzegovina

Partition resize after dd copy

When you copy a partition at the byte level (with dd or similar tools), you are copying the entire filesystem which will have the same size even in a newer, larger HDD. Therefore, it is necessery just to execute resize2fs /dev/sdX where /dev/sdX is the name of your partition. resize2fs will grow the filesystem when […]

Read more

Crypto++ VMAC issue

Well, I tried code available on http://www.cryptopp.com/wiki/VMAC in my NS-3 project on the following way: inputString = base64_encode (inputString); byte* Kkey = key->GetKey(); byte digestBytes[key->GetSize()]; byte digestBytes2[key->GetSize()]; CryptoPP::VMAC vmac; vmac.SetKeyWithIV(Kkey, key->GetSize(), m_iv, CryptoPP::AES::BLOCKSIZE); vmac.CalculateDigest(digestBytes, (byte *) inputString.c_str(), inputString.length()); //VMAC Verification vmac.SetKeyWithIV(Kkey, key->GetSize(), m_iv, CryptoPP::AES::BLOCKSIZE); vmac.CalculateDigest(digestBytes2, (byte *) inputString.c_str(), inputString.length()); std::string outputString = std::string( (char*)digestBytes, sizeof(digestBytes […]

Read more

Installing crypto++ with ns3

Installing crypto++ (libcryptopp) on Ubuntu sudo apt-get install libcrypto++-dev libcrypto++-doc libcrypto++-utils On distributions which use yum (such as Fedora): yum install cryptopp cryptopp-devel More details on: http://stackoverflow.com/questions/19187990/installing-crypto-libcryptopp-on-ubuntu and https://www.cryptopp.com/wiki/Linux Then compile and run some test.cc source file Make testcode.cc which contains following: /* -*- Mode:C++; c-file-style:”gnu”; indent-tabs-mode:nil; -*- */ #include <iostream> int main (int argc, […]

Read more

Fatal error: Class ‘Mongo’ not found – WAMP

If you have a problem to install Mongo on Wamp you might be interested in the following trick. Platform:Windows 7 64bit PHP 5.5.12 Apache2.4.9 Download your php_mongo.dll driver from https://s3.amazonaws.com/drivers.mongodb.org/php/index.html and extract it into C:\wamp\bin\php\php5.5.12\ext Then simply copy “libsasl.dll” from C:\wamp\bin\php\php5.5.12 to C:\wamp\bin\apache\apache2.4.9\bin. Refresh your wamp (right click->refresh) and restart all your services. If you have the […]

Read more