Your're doing it the hard way.
Since you intend for the server to be on your local machine (or a different machine of yours locally). The text will exist in plaintext:
- in the keyboard you are typing it on
- within your browser's state and computer's memory
- perhaps on disk swap
If your local machine is compromised, the best encryption in the world doesn't protect you. Edit the file locally using your favorite editor and encrypt it locally with your encryption of choice. It beats having to re-invent two wheels.
If you are doing this as an academic exercise, have fun, but some random blogger's PHP implementation of AES is best not trusted unless you've reviewed the code for holes yourself and have tested its output against a reference AES for many inputs. I'm not assuming malice on the PHP author's side, just that the smallest defect in cryptographic software tends to make it useless.
at least i do not get the idea behind it. whats the real problem you want to get solved? – akira – 2010-06-30T15:11:06.400
I am trying to have data saved on a website/remote location without any chance of the remote location decrypting my data. – None – 2010-06-30T18:58:14.997