Class Encrypted
An encrypted string stores binary string data encrypted in-memory. It is primarily used internally for strings that store passwords that should not appear readable in debug output.
The encrypted data is transparently decrypted on access. Use should be restricted to short strings due to the involved computational overhead.
Acknowledgements
Both DES encryption _encrypt_DES() and decryption _decrypt_DES() methods are based on an implementation by the following authors:
- PHP version by Paul Tero, July 2001, http://www.tero.co.uk/des/.
- Optimised for performance with large blocks by Michael Hayworth, November 2001, http://www.netdealing.com/.
- Converted from JavaScript to PHP by Jim Gibbs, June 2004.
- Updated to be safe in PHP on 64-bit architectures by Jirka Pech, July 2007, http://hq.cz/.
DES Encryption and Decryption License
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- Core\Object implements Core\Chainable
-
Core\Set implements Core\Accessor
-
Core\Type\ImmutableString implements ArrayAccess, Core\Comparable, Core\Equality, Iterator, Core\Masquerade
-
Core\String\Encrypted
Package: Core\Type
See: String
Since: 3.1
Requires: PHP 5.3
Version: 1.1
Located at String/Encrypted.inc.php
Methods summary
public
|
|
public
string
|
|
protected
|
|
protected
|
|
public
String
|
|
public
string
|
|
public
String
|
|
public
string
|
#
hash( )
Returns a hash value based on the actual string. The calculated hash value is based on the binary String and the associated character set. |
public
boolean
|
#
isEqualTo( $value )
Tests, whether the current String is equal to another value or object. Two String instances are equal if and only if they are based on the same character set and their string buffers are binary equal. |
public
string
|
|
public
string[]
|
|
public
String
|
#
convertTo( Charset|string $charsetNameOrObject )
Returns a String instance representing the same Unicode string with a different character set. The returned string is again encrypted. |
public
string
|
Methods inherited from Core\Type\ImmutableString
camelCaseStr()
,
compareTo()
,
deCamelCaseStr()
,
key()
,
mask()
,
next()
,
offsetExists()
,
offsetSet()
,
offsetUnset()
,
rewind()
,
splitSettingListStr()
,
valid()
Methods inherited from Core\Object
__autocreateFactory()
,
__call()
,
__processParameters()
,
attachMethod()
,
chain()
,
getValueForKey()
,
getValueForKeyPath()
,
getValueForUndefinedKey()
,
issetValueForKey()
,
setValueForKey()
,
setValueForKeyPath()
,
setValueForUndefinedKey()
,
uuid()
Constants summary
Constants inherited from Core\Object
AnyParameterType
,
AutochainParameterType
,
AutocreateParameterType
,
BooleanParameterType
,
CharParameterType
,
EnumParameterType
,
IntegerParameterType
,
RealParameterType
,
StringParameterType
,
UserParameterType
Properties summary
Properties inherited from Core\Type\ImmutableString
$_hash
,
$_position
,
$_v_binaryString
,
$_v_charset
,
$_v_length