I can make this script for you, but I'm a little busy at the moment. I might be able to do it later today for you. Or you could just take a look at
this script while you wait.
That script does exactly what you want, only I'm not sure if it uses AES or not.