Security sources said earlier the two officers were colonels but the army spokesman's Facebook page gave a different version of ranks.
The two officers were bomb disposal experts, the security sources said.
Islamist militants based in the Sinai peninsula near Israel's border have stepped up attacks on security forces since the army chief toppled President Mohamed Mursi of the Muslim Brotherhood last July. Hundreds have been killed.
The Islamist insurgency has spread to other parts of the Arab world's biggest nation, including the capital Cairo.