Gumbo_Encryption
Abstract Encryption Class
This class provides the foundation for creating encryption/decryption algorithms. The Encryption system is based on two complimentary classes. The first will Encrypt, the second Decrypt. Each class will define it's algorithm inside the 'parse' method.
The encoding option is responsible for formatting the data into a safe format, usually for saving inside a database. Typically, with the mcrypt library, the encrypted characters are not safe to input into a database. The Encode option replaces the characters with database safe ones, but does not lose any information.
Raw data indicates data that is not encrypted. An Encrypt class receives 'raw' data, a Decrypt class will generate 'raw' data. The 'parse' method should define the state of the data after completion.
Author(s): |
Michael Luster <mluster79@yahoo.com> |
License: | New BSD License |
Copyright: | Copyright (c) 2007, iBayou, Michael Luster |
Link: | http://sourceforge.net/projects/phpgumbo |
Version: | 0.0.1 |
Child classes:
Class Variables
Class Methods
Parses the data into an encrypted/decrypted format
- abstract:
- postcondition:
isRaw() => [true|false] Overridden in child classes as:
- Gumbo_Decrypt::parse()
- Parses the data by decryption
- Gumbo_Encrypt::parse()
- Parses the data by encryption
[ Top ]public void setCipher ( string $cipher ) [line 146]Sets the cipher
Parameter(s):
- (string) $cipher
- precondition:
must be a MCRYPT_* constant - throws:
Gumbo_Exception
[ Top ]public void setData ( string $data ) [line 105]Sets the data to be encrypted/decrypted
Parameter(s):
- (string) $data
- postcondition:
setRaw(true) - throws:
Gumbo_Exception
[ Top ]public void setEncode ( bool $val ) [line 241]Sets if the text should be encoded
Parameter(s):
- (bool) $val
- throws:
Gumbo_Exception
[ Top ]public void setKey ( string $key ) [line 125]Sets the key value
Parameter(s):
- (string) $key
- throws:
Gumbo_Exception
[ Top ]public void setMode ( string $mode ) [line 211]Sets the mode of encryption
Parameter(s):
- (string) $mode
- precondition:
must be a MCRYPT_MODE_* constant - throws:
Gumbo_Exception
[ Top ]protected void setRaw ( bool $val ) [line 85]Sets if the data is Raw, or encrypted/decrypted
Raw data is the initial data sent into an Encryption class. If using Encryption, this will be the data viewable to the user. If using Decryption, this would be the encrypted string.
Parameter(s):
- (bool) $val
- throws:
Gumbo_Exception
[ Top ]