root

Changeset 709

Show
Ignore:
Timestamp:
10/05/09 13:55:39 (10 months ago)
Author:
wbond
Message:

Fixed ticket #326 - changed fCryptography::symmetricKeyEncrypt() to throw an fValidationException when the $secret_key is less than 8 characters

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • fCryptography.php

    r599 r709 Hide Line Numbers
    1010 * @link       http://flourishlib.com/fCryptography 
    1111 *  
    12  * @version    1.0.0b5 
     12 * @version    1.0.0b6 
     13 * @changes    1.0.0b6  Changed ::symmetricKeyEncrypt() to throw an fValidationException when the $secret_key is less than 8 characters [wb, 2009-09-30] 
    1314 * @changes    1.0.0b5  Fixed a bug where some windows machines would throw an exception when generating random strings or numbers [wb, 2009-06-09] 
    1415 * @changes    1.0.0b4  Updated for new fCore API [wb, 2009-02-16] 
     
    485486     * Since this is symmetric-key cryptography, the same key is used for 
    486487     * encryption and decryption. 
     488     *  
     489     * @throws fValidationException  When the $secret_key is less than 8 characters long 
    487490     *   
    488491     * @param  string $plaintext   The content to be encrypted 
    489      * @param  string $secret_key  The secret key to use for encryption 
     492     * @param  string $secret_key  The secret key to use for encryption - must be at least 8 characters 
    490493     * @return string  An encrypted and base-64 encoded result containing a Flourish fingerprint and suitable for decryption using ::symmetricKeyDecrypt() 
    491494     */ 
     
    493496    { 
    494497        if (strlen($secret_key) < 8) { 
    495             throw new fProgrammerException( 
     498            throw new fValidationException( 
    496499                'The secret key specified does not meet the minimum requirement of being at least %s characters long', 
    497500                8