Securing my password wallet
Avoid calling system()
If possible, avoid calling system(). There are almost always issues doing this:

It is slow: system() will spawn another shell, which has to parse the command line you give it, and then it will spawn the actual commands you want to run).
Constructing a command line itself has all kinds of issues. For example, are you sure openssl is in your $PATH? And what if the search path finds a different version of openssl than the one you expected (/usr/bin/openssl)?
There is no easy way to send and receive data to the commands you start, so you have to redirect the input/output to files.

Especially the latter issue is important: what if someone reads /opt/PW/test.txt between the two calls to system()?
It would be much better to use a crypto library. OpenSSL is not just a program, it's also a library that you can call directly from C. However, I would say it is not the easiest to work with. There are other libraries out there that make encrypting and decrypting files easier and safer, for example NaCL.
Cryptography is hard to get right
Trying to learn about cryptography is great! However, be aware that it is not easy to get cryptography right. You are using AES-256 in ECB mode, which is bad. Furthermore, you are not using any form of message authentication, so if someone tampers with the encrypted file, then even if they cannot decrypt it properly, when you try to decrypt it you will not get the same data back as you put it. Sometimes it will be obviously garbage, but it sometimes is possible to change the data in more subtle ways (especially with ECB mode, but other modes also have issues if not combined with a MAC).
Go ahead and try to improve your program, learn more about cryptography, but I strongly suggest you do not use your cryptographic code for anything serious until you get a much better understanding of cryptography.