{"size": 602, "ext": "js", "max_stars_repo_path": "lib/services/encryption.js", "max_stars_repo_name": "RackHD/shovel", "max_stars_repo_stars_event_min_datetime": "2021-04-11T09:54:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-11T09:54:20.000Z", "max_issues_repo_path": "lib/services/encryption.js", "max_issues_repo_name": "keedya/Shovel", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/services/encryption.js", "max_forks_repo_name": "keedya/Shovel", "max_forks_repo_forks_event_min_datetime": "2016-07-20T15:04:48.000Z", "max_forks_repo_forks_event_max_datetime": "2016-07-20T15:04:48.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 28.6666666667, "max_line_length": 72, "alphanum_fraction": 0.5996677741}
/*eslint-env node*/
var crypto = require('crypto');
var config = require('./../../config.json');

var CryptoFuncs = {
    encrypt: function (text) {
        'use strict';
        var cipher = crypto.createCipher('aes-256-cbc', config.key);
        cipher.update(text, 'utf8', 'base64');
        return cipher.final('base64');
    },
    decrypt: function (text) {
        'use strict';
        var decipher = crypto.createDecipher('aes-256-cbc', config.key);
        decipher.update(text, 'base64', 'utf8');
        return decipher.final('utf8');
    }
};

module.exports = Object.create(CryptoFuncs);
