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); }
/** * @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()); } }
/** * @param $key */ public function add($key, $value) { $this->data[$key] = $this->encryption->encrypt($value); }