I'm hazy on the initial setup of AES, but I understand how the algorithm itself works once we start rounds 2-14 (subBytes, shiftRows, mixColumns, addRounKey), depending on the size of the key.
What I don't follow is the initial password and setup. Do we pick a password of any length, or we create our own 128, 192, or 256 bit password, that is then used throughout the application?
for instance, in this example of using AES with cryptojs:
var myString = "attack at dawn";
var myPassword = "superSecretPassword";
var encrypted = CryptoJS.AES.encrypt(myString, myPassword);
is the myPassword
variable run through a hash to create a 128, 192, or 256 bit key? For best security, should we make myPassword
256 bits already?