You might find some example on following sources.
http://framework.zend.com/manual/2.0/en/modules/zend.crypt.public-key.html http://static.zend.com/topics/Cryptography-made-easy-with-ZF2.pdf http://framework.zend.com/manual/2.0/en/modules/zend.crypt.block-cipher.html http://framework.zend.com/manual/2.0/en/modules/zend.crypt.password.html