CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.1 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.1
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
    • Network
      • Email
      • Http
    • Routing
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • CakeNumber
  • CakeTime
  • ClassRegistry
  • Debugger
  • File
  • Folder
  • Inflector
  • ObjectCollection
  • Sanitize
  • Security
  • Set
  • String
  • Validation
  • Xml

Class Security

Security Library contains utility methods related to security

Package: Cake\Utility
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: Cake/Utility/Security.php

Properties summary

  • $hashType public static
    string
    Default hash method

Method Summary

  • cipher() public static
    Encrypts/Decrypts a text using the given key.
  • generateAuthKey() public static
    Generate authorization hash.
  • hash() public static

    Create a hash from string using given method. Fallback on next available method.

  • inactiveMins() public static
    Get allowed minutes of inactivity based on security level.
  • setHash() public static

    Sets the default hash method for the Security object. This affects all objects using Security::hash().

  • validateAuthKey() public static
    Validate authorization hash.

Method Detail

cipher() public static ¶

cipher( string $text , string $key )

Encrypts/Decrypts a text using the given key.

Parameters
string $text
Encrypted string to decrypt, normal string to encrypt
string $key
Key to use
Returns
string
Encrypted/Decrypted string

generateAuthKey() public static ¶

generateAuthKey( )

Generate authorization hash.

Returns
string
Hash

hash() public static ¶

hash( string $string , string $type = null , boolean $salt = false )

Create a hash from string using given method. Fallback on next available method.

Parameters
string $string
String to hash
string $type optional null
Method to use (sha1/sha256/md5)
boolean $salt optional false

If true, automatically appends the application's salt value to $string (Security.salt)

Returns
string
Hash

inactiveMins() public static ¶

inactiveMins( )

Get allowed minutes of inactivity based on security level.

Returns
integer
Allowed inactivity in minutes

setHash() public static ¶

setHash( string $hash )

Sets the default hash method for the Security object. This affects all objects using Security::hash().

Parameters
string $hash
Method to use (sha1/sha256/md5)
See
Security::hash()

validateAuthKey() public static ¶

validateAuthKey( string $authKey )

Validate authorization hash.

Parameters
string $authKey
Authorization hash
Returns
boolean
Success

Properties detail

$hashType ¶

public static string

Default hash method

null
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs