A Probabilistic Formulation of Imperfect Cryptography