Avoid infinite loop on client crash
Added unit test for SymCipher