When using this very minimal CryptoJS AES example:

<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
<script type='text/javascript'>
var passphrase = "Secret";
var enc = CryptoJS.AES.encrypt("Message", passphrase);
var result = enc.toString();
var decrypted = CryptoJS.AES.decrypt(result,passphrase).toString(CryptoJS.enc.Utf8);

(Live demo here: http://jsfiddle.net/RwnYL/)

Note that the Key, IV and Salt are always different. But the output (here displayed as Base64) always starts with the same 10 characters. I'm probably missing something, but why is this?


1 Answer 1


If you decode the resulting cipher text with a base64 decoder it says:


Where XXXX changes, but "Salted__" doesn't. So I guess it is a prefix added to the ciphertext to define its format.

  • $\begingroup$ Thanks! Stupid, I never bothered to actually base64-decode it. Well that explains it :) $\endgroup$
    – RocketNuts
    Mar 20, 2014 at 9:50
  • $\begingroup$ Wouldn't that be a pretty easy distinguisher to tell if they're using this library and algorithm (AES) if it's always appending that text to the front of the ciphertext? $\endgroup$
    – NDF1
    Mar 20, 2014 at 20:00
  • 1
    $\begingroup$ Yes it would be. So what? It shouldn't matter. The algorithms and libraries used are always supposed to be known. Under the standard security models everything but the key is supposed to be public. Otherwise you are using security through obscurity. $\endgroup$
    – izaera
    Mar 20, 2014 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.