AES encryption/decryption will produce the same results on it it is provided the same parameters. Of particular interest are
- encryption key value and size
- mode: CBC, ECB, etc. (you should probably be using CBC)
- initialization vector (iv) is needed for most modes
- padding method: PKCS7, etc. (AES is a block cypher and needs input
in a multiple of block size)
As a start chose simple test data, get that working and move into more complex situations. Ex: initially choose an iv of all 0, CBC, data of exactly one block size with no padding. When that is working start adding in more complexity.
Security is not easy, the encryption part is the easy part.
Or use SSL.
For reference and learning basically everything one needs to know is in the Handbook of Applied Cryptography it is a free (and legal) pdf download, a hardcover version can also be purchased. Pros use this book, even my wife in her work.