A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
979 B

"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var sjcl = __importStar(require("sjcl"));
var SJCLEncryptionService = /** @class */ (function () {
function SJCLEncryptionService() {
this.params = { mode: "gcm", ts: 128, adata: "", iter: 10000 };
}
SJCLEncryptionService.prototype.encrypt = function (passphrase, plainText) {
return sjcl.encrypt(passphrase, plainText, this.params);
};
SJCLEncryptionService.prototype.decrypt = function (passphrase, cipher) {
return sjcl.decrypt(passphrase, cipher, undefined, undefined);
};
return SJCLEncryptionService;
}());
exports.SJCLEncryptionService = SJCLEncryptionService;