Class Secret

Description

The Secret:: class provides an API for encrypting and decrypting small pieces of data with the use of a shared key.

The Secret:: functions use the Horde Cipher:: class if mcrypt is not available.

$Horde: framework/Secret/Secret.php,v 1.45.10.14 2009/01/06 15:23:34 jan Exp $

Copyright 1999-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Secret/Secret.php (line 20)


	
			
Method Summary
 boolean clearKey ([string $keyname = 'generic'])
 string getKey ([string $keyname = 'generic'])
 string read (string $key,  $ciphertext, string $message)
 string setKey ([string $keyname = 'generic'])
 string write (string $key, string $message)
Methods
clearKey (line 186)

Clears a secret key entry from the current cookie.

  • return: True if key existed, false if not.
boolean clearKey ([string $keyname = 'generic'])
  • string $keyname: The name of the key to clear.
getKey (line 144)

Return a secret key, either from a cookie, or if the cookie isn't there, assume we are using a munged version of a known base value.

  • return: The secret key.
string getKey ([string $keyname = 'generic'])
  • string $keyname: The name of the key to get.
read (line 53)

Decrypt a message encrypted with Secret::write().

  • return: The plaintext message.
string read (string $key,  $ciphertext, string $message)
  • string $key: The key to use for decryption.
  • string $message: The ciphertext message.
  • $ciphertext
setKey (line 115)

Generate a secret key (for encryption), either using a random md5 string and storing it in a cookie if the user has cookies enabled, or munging some known values if they don't.

  • return: The secret key that has been generated.
string setKey ([string $keyname = 'generic'])
  • string $keyname: The name of the key to set.
write (line 30)

Take a small piece of data and encrypt it with a key.

  • return: The ciphertext message.
string write (string $key, string $message)
  • string $key: The key to use for encryption.
  • string $message: The plaintext message.

Documentation generated on Sun, 30 Jan 2011 05:21:08 +0000 by phpDocumentor 1.4.3