(data, encryption_key)
| 1154 | } |
| 1155 | |
| 1156 | function _encrypt(data, encryption_key) { |
| 1157 | try { |
| 1158 | const cipher_alg = 'aes-256-ctr'; |
| 1159 | if (encryption_key && encryption_key.iv && encryption_key.key) { |
| 1160 | // to decrypt text use this |
| 1161 | // var encryptedText = encryptText(cipher_alg, encryption_key.key, encryption_key.iv, data); |
| 1162 | // |
| 1163 | return encryptText(cipher_alg, encryption_key.key, encryption_key.iv, data); |
| 1164 | } |
| 1165 | return crypto.pbkdf2Sync(data, config.secureKey, 10000, 64, 'sha1').toString('base64'); |
| 1166 | } catch (err) { |
| 1167 | winston.log('error', { |
| 1168 | error: String(err), |
| 1169 | stack: new Error().stack, |
| 1170 | }); |
| 1171 | return null; |
| 1172 | } |
| 1173 | } |
| 1174 | |
| 1175 | function _recursiveModifyQuery(query, columnNames, type, encryptionKey) { |
| 1176 | for (var key in query) { |
no test coverage detected