I am having issue with CryptoJS.
I tried to encrypt the a string but it is giving the different output.
String: "test message" Key: "123456"
This is the testing code I tried to run
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
<script>
var encrypted = CryptoJS.AES.encrypt("test message", "123456");
alert(encrypted); //U2FsdGVkX19Nf4gjPS3MUcbKBD10P/Ty/4EwUF1PMhc=
</script>
and it returned the output U2FsdGVkX19Nf4gjPS3MUcbKBD10P/Ty/4EwUF1PMhc=
But in this website http://aesencryption.net/ I am getting fulfuBaIGS0AqxwyXoPCgw== as the result.
How do I use CryptoJS to generate the encrypted output as fulfuBaIGS0AqxwyXoPCgw==?
Those sites are bad, because they don't tell you what actually happens when you encrypt something. The two example codes below the online-encryption are different and don't produce the same thing as the online-encryption.
It seems this answer provides a working code in C# for that site. If this is true, then you can't reproduce this in CryptoJS, because CryptoJS only supports AES, whereas that example C# code uses Rijndael (note the block size of 256 bit).
AES is only defined for a fixed block size of 128 bit, but Rijndael supports 128, 192 and 256 bit block sizes. Both support key sizes of 128, 192 and 256 bit. CryptoJS actually implements only AES, but that site does not use AES despite its name.