K2hash::addAttrCryptPass
Adds the password to encrypt values
Description
public bool K2hash::addAttrCryptPass ( string $encpass [, bool $is_default_encrypt ] )
Adds the password to encrypt values. The encrption algorithm is AES256.
Parameters
- encpass
Specifies the password. - is_default_encrypt
Specifies true if always encrypt values, otherwise false.
Return Values
Returns true on success or false on failure.
Examples
- Example 1 - Adds a password to encypt values
<?php
$k2hash = new K2hash();
$k2hash->openMem();
var_dump($k2hash->addAttrCryptPass("testkey", true));
$k2hash->close();
?>
The above example will output:
bool(true)
See Also
- K2hash::addAttr - Adds the attribute to the key
- K2hash::addAttrPluginLib - Adds the user-defined library to handle attributes
- K2hash::cleanCommonAttribute - Initializes the common attributes
- K2hash::getAttrInfos - Prints the attribute information
- K2hash::getAttrs - Gets attributes of the key
- K2hash::getAttrValue - Gets an attribute value of the attribute key of the key
- K2hash::getAttrVersionInfos - Prints the attribute library version