I was wondering about making up a simple system to encrypt a file:
seed the random number generator with the passcode
generate as many random bits as the file has
xor
This has a vulnerability that if you encrypt two file A and B with the same passcode, xoring the two encrypted files would give the xor of A and B... so
seed the random number generator with the passcode concatenated with a hash of the file
generate as many random bits as the file has
xor
I think this fixes that vulnerability but a MITM could still flip certain bits inside the file by flipping bits on the encrypted file, so
seed the random number generator with the passcode concatenated with a hash of the file
randomly permute the plaintext in blocks of 128 bits
generate as many random bits as the file has
xor
I couldn't think of any vulnerability this system has. Do you know of any?