I'm trying to write my own DES encryption program without using the .NET libraries.
However, after going through all the steps I noticed my file gets twice as big!
I'm reading from a txt file (byte by byte) into a list of BitArrays
, and after a few conversions I end up with a list of byte[]
arrays. Finally I write these to another txt file. All the arrays never change in size (always 64 bits or 8 bytes).
Has this got anything to do with encoding? I know it's ANSI, but since I'm not getting the required result back after decrypting, I think it's either the encoding or my logic.
Thanks in advance.
If you have <= 8 symbols in your txt, than you should receive 8 encoded bytes. If 9 - 16 bytes (with 7 padding bytes). This is the only case when your close to have twice as big encrypted file