xplo.re Medusa Core Framework 3.1
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Encrypted

Constants

  • EncryptionKey

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
Extended by Core\Set implements Core\Accessor
Extended by Core\String implements ArrayAccess, Core\Comparable, Core\Equality, Iterator, Core\Masquerade
Extended by Core\String\Encrypted
Namespace: Core\String
Package: Core\String
See: Core\String
Since: 3.1
Requires: PHP 5.3
Version: 1.0
Located at String/Encrypted.inc.php

Methods summary

public
# __construct( $string, $charset = null )

Initialises a new encrypted String instance.

Initialises a new encrypted String instance.

Parameters

$string
string or String instance to initialise String object with.
$charset

set instance or name of character set to use. Defaults to the currently active character set.

Throws

Core\Exception\InvalidArgument
The provided character set name or alias is invalid.

Since

3.1

Overrides

Core\String::__construct
public string
# __toString( )

Returns the native (decrypted) representation of the string.

Returns the native (decrypted) representation of the string.

Returns

string
The decrypted content of the binary string buffer.

Since

3.1

Overrides

Core\String::__toString
protected
# _decrypt( boolean $restore = false )

Parameters

$restore
protected
# _encrypt( $string )

Parameters

$string
public string
# current( )

Returns the current character string (used by iterators).

Returns the current character string (used by iterators).

Returns

string
Current character string.

Since

3.1

Overrides

Core\String::current
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.

Returns a hash value based on the actual string. The calculated hash value is based on the binary String and the associated character set.

Returns

string
Hash value of the object.

Since

3.1

Overrides

Core\String::hash
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.

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.

Parameters

$value

or object to test for equality with the current String. If the provided value is not a String instance, the value is automatically converted to a String before testing for equality.

Returns

boolean

Returns true, if the provided value and the current String are equal, otherwise false.

Since

3.1

Overrides

Core\String::isEqualTo
public string
# offsetGet( $index )

Returns the character string at the given position.

Returns the character string at the given position.

Parameters

$index
index of desired character string of the String object.

Returns

string
Character string at the desired index.

Throws

Core\Exception\OutOfBounds
The requested index is invalid.

Since

3.1

Overrides

Core\String::offsetGet
public string[]
# splitSettingList( )

Returns an array of list elements extracted from the current string.

Returns an array of list elements extracted from the current string.

Returns

string[]
Array of list elements.

Since

3.1

Overrides

Core\String::splitSettingList
public Core\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.

Returns a String instance representing the same Unicode string with a different character set. The returned string is again encrypted.

Parameters

$charsetNameOrObject
Character set instance or name of converted result.

Returns

Core\String

New string instance with a different character set than the current String instance or the current instance, if the character sets match.

Since

3.1

Overrides

Core\String::convertTo
public string
# unmask( )

Subclasses that store the internal string value in a modified form, e.g. encrypted, must return the original string data.

Returns

string
Binary string stored by this String instance.

Since

3.1

Overrides

Core\String::unmask

Methods inherited from Core\String

compareTo(), key(), mask(), next(), offsetExists(), offsetSet(), offsetUnset(), rewind(), splitSettingListStr(), valid()

Methods inherited from Core\Set

__get(), __isset()

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\String

$_hash, $_position, $_v_binaryString, $_v_charset, $_v_length

Magic properties inherited from Core\String

$binaryString, $charset, $hash, $length

Magic properties inherited from Core\Object

$uuid

xplo.re Medusa Core Framework 3.1 API documentation generated by ApiGen