Approximating Imperfect Cryptography in a Formal Model