Moved encryption service to common

This commit is contained in:
Rohan Sircar 2020-06-20 19:52:36 +05:30
parent 944377f111
commit e06d98752a
6 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
import { EncryptionService } from "./EncryptionService"; import { EncryptionService } from "../../common/service/EncryptionService";
import { SJCLEncryptionService } from "./SJCLEncryptionService"; import { SJCLEncryptionService } from "../../common/service/SJCLEncryptionService";
// import PromiseWorker = require('promise-worker'); // import PromiseWorker = require('promise-worker');
import PromiseWorker from "promise-worker"; import PromiseWorker from "promise-worker";

View File

@ -4,7 +4,7 @@ import { ChatMessageDTO } from "../dto/ChatMessageDTO";
import { MessageCipherDTO } from "../dto/MessageCipherDTO"; import { MessageCipherDTO } from "../dto/MessageCipherDTO";
import { ChatModel } from "../../common/model/ChatModel"; import { ChatModel } from "../../common/model/ChatModel";
import { Observer } from "../observe/Observer"; import { Observer } from "../observe/Observer";
import { EncryptionService } from "../service/EncryptionService"; import { EncryptionService } from "../../common/service/EncryptionService";
import { MarkDownService } from "../service/MarkDownService"; import { MarkDownService } from "../service/MarkDownService";
import { JsonAPI } from "../singleton/JsonAPI"; import { JsonAPI } from "../singleton/JsonAPI";
import { ChatMessageViewModel } from "../viewmodel/ChatMessageViewModel"; import { ChatMessageViewModel } from "../viewmodel/ChatMessageViewModel";

View File

@ -1,7 +1,7 @@
import { ChatMessageViewModel } from "../viewmodel/ChatMessageViewModel"; import { ChatMessageViewModel } from "../viewmodel/ChatMessageViewModel";
import { ChatModel } from "../../common/model/ChatModel"; import { ChatModel } from "../../common/model/ChatModel";
import { MarkDownService } from "../service/MarkDownService"; import { MarkDownService } from "../service/MarkDownService";
import { EncryptionService } from "../service/EncryptionService"; import { EncryptionService } from "../../common/service/EncryptionService";
import { NotificationService } from "../service/NotificationService"; import { NotificationService } from "../service/NotificationService";
import { UserModel } from "../../common/model/UserModel"; import { UserModel } from "../../common/model/UserModel";

View File

@ -1,6 +1,6 @@
import * as log from "loglevel"; import * as log from "loglevel";
import { ChatMessageDTO } from "../../chat/dto/ChatMessageDTO"; import { ChatMessageDTO } from "../../chat/dto/ChatMessageDTO";
import { EncryptionService } from "../../chat/service/EncryptionService"; import { EncryptionService } from "../service/EncryptionService";
import { NotificationService } from "../../chat/service/NotificationService"; import { NotificationService } from "../../chat/service/NotificationService";
import { JsonAPI } from "../../chat/singleton/JsonAPI"; import { JsonAPI } from "../../chat/singleton/JsonAPI";
import { Sprintf } from "../../chat/singleton/Sprintf"; import { Sprintf } from "../../chat/singleton/Sprintf";

View File

@ -1,4 +1,4 @@
import { MessageCipherDTO } from "../dto/MessageCipherDTO"; import { MessageCipherDTO } from "../../chat/dto/MessageCipherDTO";
export interface EncryptionService { export interface EncryptionService {
encrypt(passphrase: string, plainText: string): any; encrypt(passphrase: string, plainText: string): any;

View File

@ -1,6 +1,6 @@
import { EncryptionService } from "./EncryptionService"; import { EncryptionService } from "./EncryptionService";
import * as sjcl from "sjcl"; import * as sjcl from "sjcl";
import { MessageCipherDTO } from "../dto/MessageCipherDTO"; import { MessageCipherDTO } from "../../chat/dto/MessageCipherDTO";
import PromiseWorker from "promise-worker"; import PromiseWorker from "promise-worker";
export class SJCLEncryptionService implements EncryptionService { export class SJCLEncryptionService implements EncryptionService {
private _params: sjcl.SjclCipherParams = { mode: "gcm", ts: 128, adata: "", iter: 10000 }; private _params: sjcl.SjclCipherParams = { mode: "gcm", ts: 128, adata: "", iter: 10000 };