A generic interface for cryptographic operations