示例#1
0
 /**
  * Set the encryption salt to a new value.
  *
  * @param string $salt
  */
 public static function setSalt($salt)
 {
     self::$salt = (string) $salt;
 }
示例#2
0
 /**
  * Test that setting encryption salt has an effect.
  */
 function testSetSaltHasAnAffectOnEncryptedValues()
 {
     T_Filter_Crypt::setSalt('first');
     $crypt1 = new T_Filter_Crypt('password', 'rijndael-256', 'ecb');
     $encrypted1 = $crypt1->transform('value');
     T_Filter_Crypt::setSalt('second');
     $crypt2 = new T_Filter_Crypt('password', 'rijndael-256', 'ecb');
     $encrypted2 = $crypt2->transform('value');
     $this->assertNotSame($encrypted1, $encrypted2);
 }