diff --git a/src/detail/ca-sqlite.cpp b/src/detail/ca-sqlite.cpp
index b0d6af5..468fd2c 100644
--- a/src/detail/ca-sqlite.cpp
+++ b/src/detail/ca-sqlite.cpp
@@ -66,7 +66,8 @@
     remaining_tries INTEGER,
     remaining_time INTEGER,
     challenge_secrets TEXT,
-    encryption_key BLOB NOT NULL
+    encryption_key BLOB NOT NULL,
+    aes_block_counter INTEGER
   );
 CREATE UNIQUE INDEX IF NOT EXISTS
   CaStateIdIndex ON CaStates(request_id);
@@ -128,7 +129,8 @@
                              R"_SQLTEXT_(SELECT id, ca_name, status,
                              challenge_status, cert_request,
                              challenge_type, challenge_secrets,
-                             challenge_tp, remaining_tries, remaining_time, request_type, encryption_key
+                             challenge_tp, remaining_tries, remaining_time,
+                             request_type, encryption_key, aes_block_counter
                              FROM CaStates where request_id = ?)_SQLTEXT_");
   statement.bind(1, requestId, SQLITE_TRANSIENT);
 
@@ -144,11 +146,12 @@
     auto remainingTime = statement.getInt(9);
     auto requestType = static_cast<RequestType>(statement.getInt(10));
     auto encryptionKey = statement.getBlock(11);
+    auto aesCounter = statement.getInt(12);
     if (challengeType != "") {
       return CaState(caName, requestId, requestType, status, cert,
                      challengeType, challengeStatus, time::fromIsoString(challengeTp),
                      remainingTries, time::seconds(remainingTime),
-                     convertString2Json(challengeSecrets), encryptionKey);
+                     convertString2Json(challengeSecrets), encryptionKey, aesCounter);
     }
     else {
       return CaState(caName, requestId, requestType, status, cert, encryptionKey);
@@ -166,14 +169,15 @@
       m_database,
       R"_SQLTEXT_(INSERT OR ABORT INTO CaStates (request_id, ca_name, status, request_type,
                   cert_request, challenge_type, challenge_status, challenge_secrets,
-                  challenge_tp, remaining_tries, remaining_time, encryption_key)
-                  values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))_SQLTEXT_");
+                  challenge_tp, remaining_tries, remaining_time, encryption_key, aes_block_counter)
+                  values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))_SQLTEXT_");
   statement.bind(1, request.m_requestId, SQLITE_TRANSIENT);
   statement.bind(2, request.m_caPrefix.wireEncode(), SQLITE_TRANSIENT);
   statement.bind(3, static_cast<int>(request.m_status));
   statement.bind(4, static_cast<int>(request.m_requestType));
   statement.bind(5, request.m_cert.wireEncode(), SQLITE_TRANSIENT);
   statement.bind(12, request.m_encryptionKey, SQLITE_TRANSIENT);
+  statement.bind(13, request.m_aesBlockCounter);
   if (request.m_challengeState) {
     statement.bind(6, request.m_challengeType, SQLITE_TRANSIENT);
     statement.bind(7, request.m_challengeState->m_challengeStatus, SQLITE_TRANSIENT);
@@ -194,7 +198,7 @@
   Sqlite3Statement statement(m_database,
                              R"_SQLTEXT_(UPDATE CaStates
                              SET status = ?, challenge_type = ?, challenge_status = ?, challenge_secrets = ?,
-                             challenge_tp = ?, remaining_tries = ?, remaining_time = ?
+                             challenge_tp = ?, remaining_tries = ?, remaining_time = ?, aes_block_counter = ?
                              WHERE request_id = ?)_SQLTEXT_");
   statement.bind(1, static_cast<int>(request.m_status));
   statement.bind(2, request.m_challengeType, SQLITE_TRANSIENT);
@@ -212,7 +216,8 @@
     statement.bind(6, 0);
     statement.bind(7, 0);
   }
-  statement.bind(8, request.m_requestId, SQLITE_TRANSIENT);
+  statement.bind(8, request.m_aesBlockCounter);
+  statement.bind(9, request.m_requestId, SQLITE_TRANSIENT);
 
   if (statement.step() != SQLITE_DONE) {
     addRequest(request);
@@ -225,7 +230,8 @@
   std::list<CaState> result;
   Sqlite3Statement statement(m_database, R"_SQLTEXT_(SELECT id, request_id, ca_name, status,
                              challenge_status, cert_request, challenge_type, challenge_secrets,
-                             challenge_tp, remaining_tries, remaining_time, request_type, encryption_key
+                             challenge_tp, remaining_tries, remaining_time, request_type,
+                             encryption_key, aes_block_counter
                              FROM CaStates)_SQLTEXT_");
   while (statement.step() == SQLITE_ROW) {
     auto requestId = statement.getString(1);
@@ -240,14 +246,15 @@
     auto remainingTime = statement.getInt(10);
     auto requestType = static_cast<RequestType>(statement.getInt(11));
     auto encryptionKey = statement.getBlock(12);
+    auto aesBlockCounter = statement.getInt(13);
     if (challengeType != "") {
       result.push_back(CaState(caName, requestId, requestType, status, cert,
                                challengeType, challengeStatus, time::fromIsoString(challengeTp),
                                remainingTries, time::seconds(remainingTime),
-                               convertString2Json(challengeSecrets), encryptionKey));
+                               convertString2Json(challengeSecrets), encryptionKey, aesBlockCounter));
     }
     else {
-      result.push_back(CaState(caName, requestId, requestType, status, cert, encryptionKey));
+      result.push_back(CaState(caName, requestId, requestType, status, cert, encryptionKey, aesBlockCounter));
     }
   }
   return result;
@@ -260,7 +267,8 @@
   Sqlite3Statement statement(m_database,
                              R"_SQLTEXT_(SELECT id, request_id, ca_name, status,
                              challenge_status, cert_request, challenge_type, challenge_secrets,
-                             challenge_tp, remaining_tries, remaining_time, request_type, encryption_key
+                             challenge_tp, remaining_tries, remaining_time, request_type, 
+                             encryption_key, aes_block_counter
                              FROM CaStates WHERE ca_name = ?)_SQLTEXT_");
   statement.bind(1, caName.wireEncode(), SQLITE_TRANSIENT);
 
@@ -277,14 +285,15 @@
     auto remainingTime = statement.getInt(10);
     auto requestType = static_cast<RequestType>(statement.getInt(11));
     auto encryptionKey = statement.getBlock(12);
+    auto aesBlockCounter = statement.getInt(13);
     if (challengeType != "") {
       result.push_back(CaState(caName, requestId, requestType, status, cert,
                                challengeType, challengeStatus, time::fromIsoString(challengeTp),
                                remainingTries, time::seconds(remainingTime),
-                               convertString2Json(challengeSecrets), encryptionKey));
+                               convertString2Json(challengeSecrets), encryptionKey, aesBlockCounter));
     }
     else {
-      result.push_back(CaState(caName, requestId, requestType, status, cert, encryptionKey));
+      result.push_back(CaState(caName, requestId, requestType, status, cert, encryptionKey, aesBlockCounter));
     }
   }
   return result;
