import CryptoJS from 'crypto-js'
class CryptToJS {
    private crypt: typeof CryptoJS;
    private secret: string;
    constructor() {
        this.crypt = CryptoJS;
        this.secret = 'Believe in yourself.';
    }
    public encrypt(text: string): string {
        return this.crypt.AES.encrypt(text, this.secret).toString();
    }
    public decrypt(text: string): string {
        if (text == null || text.length === 0) {
            return "";
        }
        return this.crypt.AES.decrypt(text, this.secret).toString(CryptoJS.enc.Utf8);
    }
}
export default new CryptToJS();