Class Hybrid

Summary

Fully Qualified Name: Zend\Crypt\Hybrid

Description

Hybrid encryption (OpenPGP like)

The data are encrypted using a BlockCipher with a random session key that is encrypted using RSA with the public key of the receiver. The decryption process retrieves the session key using RSA with the private key of the receiver and decrypts the data using the BlockCipher.

Methods

Name Description Defined By
__construct() Constructor Hybrid
decrypt() Decrypt using a private key Hybrid
encrypt() Encrypt using a keyrings Hybrid
getBlockCipherInstance() Get the BlockCipher adapter Hybrid
getRsaInstance() Get the Rsa instance Hybrid

Method Details

__construct()

Constructor

Parameter Name Type Description
$bCipher \BlockCipher
$rsa \PublicKey\Rsa

Returns:

decrypt()

Decrypt using a private key

Parameter Name Type Description
$msg string
$privateKey string
$passPhrase string
$id string

Returns: string

encrypt()

Encrypt using a keyrings

Parameter Name Type Description
$plaintext string
$keys array|string

Returns: string

getBlockCipherInstance()

Get the BlockCipher adapter

Returns: \BlockCipher

getRsaInstance()

Get the Rsa instance

Returns: \Rsa

Top