Both MD5 and SHA256 are used as hashing algorithms. They take an input file and generate an output which can be of 256/128-bit size. This output represents a checksum or hash value. As, collisions are very rare between hash values, so no encryption takes place.
Concluding all points, it will be better to use MDA5 if you want to secure your files otherwise you can use SHA256.