Encryption helpers
($data, $encryptionKey)
| 185 | |
| 186 | // Encryption helpers |
| 187 | function encryptData($data, $encryptionKey) |
| 188 | { |
| 189 | $cipher = 'AES-256-CBC'; |
| 190 | $ivlen = openssl_cipher_iv_length($cipher); |
| 191 | $iv = openssl_random_pseudo_bytes($ivlen); |
| 192 | $ct = openssl_encrypt($data, $cipher, $encryptionKey, OPENSSL_RAW_DATA, $iv); |
| 193 | return base64_encode($iv . $ct); |
| 194 | } |
| 195 | |
| 196 | function decryptData($encryptedData, $encryptionKey) |
| 197 | { |
no outgoing calls
no test coverage detected