public function EncryptionMethodInterface::encrypt in Encrypt 8.3
Encrypt text.
Parameters
string $text: The text to be encrypted.
string $key: The key to encrypt the text with.
Return value
string The encrypted text
Throws
\Drupal\encrypt\Exception\EncryptException Thrown when encryption fails.
3 methods override EncryptionMethodInterface::encrypt()
- AsymmetricalEncryptionMethod::encrypt in tests/
modules/ encrypt_test/ src/ Plugin/ EncryptionMethod/ AsymmetricalEncryptionMethod.php - Encrypt text.
- ConfigTestEncryptionMethod::encrypt in tests/
modules/ encrypt_test/ src/ Plugin/ EncryptionMethod/ ConfigTestEncryptionMethod.php - Encrypt text.
- TestEncryptionMethod::encrypt in tests/
modules/ encrypt_test/ src/ Plugin/ EncryptionMethod/ TestEncryptionMethod.php - Encrypt text.
File
- src/
EncryptionMethodInterface.php, line 28
Class
- EncryptionMethodInterface
- Provides an interface for EncryptionMethod plugins.
Namespace
Drupal\encryptCode
public function encrypt($text, $key);