Refactored cipher interface.