[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/ -> Secret.php (sommaire)

(pas de description)

Poids: 173 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Secret:: (5 méthodes):
  write()
  read()
  setKey()
  getKey()
  clearKey()


Classe: Secret  - X-Ref

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.7 2006/03/02 05:25:10 slusarz Exp $

Copyright 1999-2006 Chuck Hagenbuch <chuck@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.

write($key, $message)   X-Ref
Take a small piece of data and encrypt it with a key.

param: string $key      The key to use for encryption.
param: string $message  The plaintext message.
return: string  The ciphertext message.

read($key, $ciphertext)   X-Ref
Decrypt a message encrypted with Secret::write().

param: string $key      The key to use for decryption.
param: string $message  The ciphertext message.
return: string  The plaintext message.

setKey($keyname = 'generic')   X-Ref
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.

param: string $keyname  The name of the key to set.
return: string  The secret key that has been generated.

getKey($keyname = 'generic')   X-Ref
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.

param: string $keyname  The name of the key to get.
return: string  The secret key.

clearKey($keyname = 'generic')   X-Ref
Clears a secret key entry from the current cookie.

param: string $keyname  The name of the key to clear.
return: boolean  True if key existed, false if not.



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7