But then, how do you lose all data on sdcard after encrypting it, and then factory resetting it?
That would not be the case if it was a hardware thing.
I encrypted my sdcard, put it on my pc, scanned md5 of a file, DIDN'T EDIT IT IN ANY WAY, and then decrypted my sdcard, and encrypted it again...