Security models in rewriting logic for cryptographic protocols and browsers