| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 57 | public function decryptData(string $data) |
||
| 58 | { |
||
| 59 | $encryptionKey = $this->config |
||
| 60 | ->getEncryptionKey(); |
||
| 61 | |||
| 62 | $dataChunks = explode(static::INIT_VECTOR_SEPARATOR, $data); |
||
| 63 | if (count($dataChunks) !== 2) { |
||
| 64 | return null; |
||
| 65 | } |
||
| 66 | |||
| 67 | [$encryptedData, $initVector] = $dataChunks; |
||
| 68 | |||
| 69 | return openssl_decrypt( |
||
| 70 | $encryptedData, |
||
| 71 | static::CYPHER_METHOD, |
||
| 72 | $encryptionKey, |
||
| 73 | OPENSSL_RAW_DATA, |
||
| 74 | base64_decode($initVector) |
||
| 75 | ); |
||
| 88 |