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
diff --git a/src/security/sec-tpm-file.hpp b/src/security/sec-tpm-file.hpp
index d0a68b8..7a92ec1 100644
--- a/src/security/sec-tpm-file.hpp
+++ b/src/security/sec-tpm-file.hpp
@@ -108,6 +108,8 @@
 
   std::string
   nameTransform(const std::string &keyName, const std::string &extension);
+  virtual bool
+  generateRandomBlock(uint8_t* res, size_t size);
 
 private:
   void 
@@ -115,8 +117,9 @@
   
 private:
   class Impl;
-  std::auto_ptr<Impl> impl_;
+  shared_ptr<Impl> m_impl;
 };
+
 }//ndn
 
 #endif
diff --git a/src/security/sec-tpm-memory.cpp b/src/security/sec-tpm-memory.cpp
index a72e385..a115d48 100644
--- a/src/security/sec-tpm-memory.cpp
+++ b/src/security/sec-tpm-memory.cpp
@@ -13,6 +13,7 @@
 #include <openssl/ssl.h>
 #include <openssl/sha.h>
 #include <openssl/rsa.h>
+#include <cryptopp/osrng.h>
 
 using namespace std;
 
@@ -154,4 +155,16 @@
     return false;
 }
 
+bool
+SecTpmMemory::generateRandomBlock(uint8_t* res, size_t size)
+{
+  try{
+    CryptoPP::AutoSeededRandomPool rng;
+    rng.GenerateBlock(res, size);
+    return true;
+  }catch(const CryptoPP::Exception& e){
+    return false;
+  }
+}
+
 }
diff --git a/src/security/sec-tpm-memory.hpp b/src/security/sec-tpm-memory.hpp
index 38bc5ff..69f5052 100644
--- a/src/security/sec-tpm-memory.hpp
+++ b/src/security/sec-tpm-memory.hpp
@@ -107,6 +107,9 @@
   virtual void 
   generateSymmetricKeyInTpm(const Name& keyName, KeyType keyType, int keySize);
 
+  virtual bool
+  generateRandomBlock(uint8_t* res, size_t size);
+
   /**
    * Check if a particular key exists.
    * @param keyName The name of the key.
diff --git a/src/security/sec-tpm-osx.cpp b/src/security/sec-tpm-osx.cpp
index 27039bf..3f14f43 100644
--- a/src/security/sec-tpm-osx.cpp
+++ b/src/security/sec-tpm-osx.cpp
@@ -19,6 +19,7 @@
 
 #include <CoreFoundation/CoreFoundation.h>
 #include <Security/Security.h>
+#include <Security/SecRandom.h>
 #include <CoreServices/CoreServices.h>
 
 using namespace std;
@@ -562,6 +563,11 @@
 
 }
 
+bool
+SecTpmOsx::generateRandomBlock(uint8_t* res, size_t size)
+{
+  return (SecRandomCopyBytes(kSecRandomDefault, size, res) == 0);
+}
 
 ////////////////////////////////
 // OSXPrivateKeyStorage::Impl //
diff --git a/src/security/sec-tpm-osx.hpp b/src/security/sec-tpm-osx.hpp
index 1f95cdc..c4a4972 100644
--- a/src/security/sec-tpm-osx.hpp
+++ b/src/security/sec-tpm-osx.hpp
@@ -86,7 +86,10 @@
    * @return True if the key exists, otherwise false.
    */
   virtual bool
-  doesKeyExistInTpm(const Name& keyName, KeyClass keyClass);  
+  doesKeyExistInTpm(const Name& keyName, KeyClass keyClass); 
+
+  virtual bool
+  generateRandomBlock(uint8_t* res, size_t size); 
 
 
   ////////////////////////////////////////////////////////////////////////////////////
@@ -117,7 +120,7 @@
 
  private:
   class Impl;
-  std::auto_ptr<Impl> m_impl;
+  shared_ptr<Impl> m_impl;
 };
   
 } // namespace ndn
diff --git a/src/security/sec-tpm.hpp b/src/security/sec-tpm.hpp
index ec3334d..9c15ad7 100644
--- a/src/security/sec-tpm.hpp
+++ b/src/security/sec-tpm.hpp
@@ -102,6 +102,16 @@
    */
   virtual bool
   doesKeyExistInTpm(const Name& keyName, KeyClass keyClass) = 0;  
+
+  /**
+   * @brief Generate a random number.
+   * 
+   * @param res The pointer to the generated number.
+   * @param size The random number size.
+   * @return true for success, otherwise false.
+   */
+  virtual bool
+  generateRandomBlock(uint8_t* res, size_t size) = 0;
 };
 
 }
