Since AES CTR mode uses a unique IV and counter to produce the key to XOR with the plain text to get the ciphertext, the question is so as to how decryption is done. Since AES CTR produces a different cipher each time for the same password and plain text due to the unique key, how is it possible for the decryption function to produce the same key for a given password to get back the plain text?
Can anyone please explain me on how this is happening?
The IV/counter affect the cipher input and so the keystream varies.
The reason this can be decrypted is that the decrypter knows both the key and the IV/counter. They can calculate exactly the same function as the encrypter did, resulting in the same keystream block, which a XOR then cancels out.
The images on the wiki page for block cipher modes show how both sides compute the same thing.