0

I am using the below javascript code to encrypt the values. This is working fine. I would like to decrypt the values in vb.net code behind. Please help me to do this.

    var key = CryptoJS.enc.Utf8.parse('7061737323313233');
    var iv = CryptoJS.enc.Utf8.parse('7061737323313233');
    function Encryption() {

        var min = 1;
        var max = 6;

        var now = new Date();
        var validDate = now.getDate() + '-' + now.getMonth() + '-' + now.getFullYear();
        var random = Math.floor(Math.random() * (max - min + 1)) + min;

        var encrypted = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(getRandomKey(random, validDate)), key,
        {
            keySize: 128 / 8,
            iv: iv,
            mode: CryptoJS.mode.CBC,
            padding: CryptoJS.pad.Pkcs7
        });

    }

0 Answers0