diff --git a/src/security/sec-tpm-file.cpp b/src/security/sec-tpm-file.cpp
index 52f14ba..47cf83b 100644
--- a/src/security/sec-tpm-file.cpp
+++ b/src/security/sec-tpm-file.cpp
@@ -35,7 +35,7 @@
 
 class SecTpmFile::Impl {
 public:
-  Impl(const string &dir)
+  Impl(const string& dir)
   {
     if(dir.empty())
       m_keystorePath = boost::filesystem::path(getenv("HOME")) / ".ndnx" / "ndnsec-tpm-file";
@@ -49,8 +49,9 @@
   boost::filesystem::path m_keystorePath;
 };
 
+
 SecTpmFile::SecTpmFile(const string & dir)
-  : impl_(new Impl(dir))
+  : m_impl(new Impl(dir))
 {}
 
 void
@@ -70,7 +71,9 @@
     switch(keyType){
     case KEY_TYPE_RSA:
       {
-	AutoSeededRandomPool rng;
+        using namespace CryptoPP;
+        AutoSeededRandomPool rng;
+
 	InvertibleRSAFunction privateKey;
 	privateKey.Initialize(rng, keySize);
 	
@@ -139,8 +142,9 @@
     throw Error("private key doesn't exists");
  
   try{
+    using namespace CryptoPP;
     AutoSeededRandomPool rng;
-      
+
     //Read private key
     ByteQueue bytes;
     string privateKeyFileName = nameTransform(keyURI, ".pri");
@@ -180,8 +184,9 @@
 	throw Error("private key doesn't exist");
 
       try{
-	AutoSeededRandomPool rng;
-	
+	using namespace CryptoPP;
+        AutoSeededRandomPool rng;
+
 	//Read private key
 	ByteQueue bytes;
 	string privateKeyFileName = nameTransform(keyURI, ".pri");
@@ -241,7 +246,8 @@
 	throw Error("public key doesn't exist");
       try
 	{
-	  AutoSeededRandomPool rng;
+          using namespace CryptoPP;
+          AutoSeededRandomPool rng;
 
 	  //Read private key
 	  ByteQueue bytes;
@@ -307,9 +313,11 @@
     switch(keyType){
     case KEY_TYPE_AES:
       {
-	AutoSeededRandomPool rnd;
+        using namespace CryptoPP;
+        AutoSeededRandomPool rng;
+
 	SecByteBlock key(0x00, keySize);
-	rnd.GenerateBlock(key, keySize );
+	rng.GenerateBlock(key, keySize);
 	
 	StringSource(key, key.size(), true, new HexEncoder(new FileSink(symKeyFileName.c_str())));
 	
@@ -376,18 +384,30 @@
         }
     }
 
-  return (impl_->m_keystorePath / (digest + extension)).string();
+  return (m_impl->m_keystorePath / (digest + extension)).string();
 }
 
 void 
 SecTpmFile::maintainMapping(string str1, string str2)
 {
   std::ofstream outfile;
-  string dirFile = (impl_->m_keystorePath / "mapping.txt").string();
+  string dirFile = (m_impl->m_keystorePath / "mapping.txt").string();
 
   outfile.open(dirFile.c_str(), std::ios_base::app);
   outfile << str1 << ' ' << str2 << '\n';
   outfile.close();
 }
 
+bool
+SecTpmFile::generateRandomBlock(uint8_t* res, size_t size)
+{
+  try{
+    CryptoPP::AutoSeededRandomPool rng;
+    rng.GenerateBlock(res, size);
+    return true;
+  }catch(const CryptoPP::Exception& e){
+    return false;
+  }
+}
+
 } //ndn
