How to properly AES encrypt a string, deriving the key from the same string?
My question: Unless there is a better approach, what would be the best strategy to strengthen the security, e.g. generating secure keys?


When you want to derive key for cipher, do use a KDF, ciphers require high-entropy key on all it's length to avoid potential weaknesses. Also, this way you avoid any problems with strings longer than your key size is.

But it appears that you don't need encryption at all. You can just get hash for every item. Then you can check list for duplicates, and request for original text, which then you can validate because you have hash. This is very same as encryption, except you can theoretically get collisions (but if you find collision in modern hash, that would be something special - nobody yet managed it).