예제 #1
0
 public function testEncryptGeneratesDifferentStringsForSameValue()
 {
     $string = 'my big fat secret';
     $encrypted_1 = $this->encryption->encrypt($string);
     $encrypted_2 = $this->encryption->encrypt($string);
     $this->assertFalse($encrypted_1 == $encrypted_2);
 }
예제 #2
0
파일: Redis.php 프로젝트: RepoMon/tokens
 /**
  * @param $key
  * @param $value
  * @throws UnavailableException
  */
 public function add($key, $value)
 {
     // encrypt the tokens before storing in redis
     try {
         $this->client->set($key, $this->encryption->encrypt($value));
     } catch (ServerException $ex) {
         throw new UnavailableException($ex->getMessage());
     }
 }
예제 #3
0
파일: Memory.php 프로젝트: RepoMon/tokens
 /**
  * @param $key
  */
 public function add($key, $value)
 {
     $this->data[$key] = $this->encryption->encrypt($value);
 }